Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Rare bug on CtrlCore/ImageWin32.cpp
Rare bug on CtrlCore/ImageWin32.cpp [message #46058] Fri, 26 February 2016 04:39 Go to next message
rxantos is currently offline  rxantos
Messages: 72
Registered: October 2011
Member
On function
void ImageSysData::Paint(SystemDraw& w, int x, int y, const Rect& src, Color c);


Search for
if(!himg) {
  LTIMING("Image Alpha create");
  BitmapInfo32__ bi(sz.cx, sz.cy);
  himg = CreateDIBSection(ScreenHDC(), bi, DIB_RGB_COLORS, (void **)&section, NULL, 0);
  Copy(section, ~img, img.GetLength());
}


Sometimes CreateDIBSection fails. Is rare, but it does happen returning 0 in the process, which causes the Copy function to crash the application.
Propose to change with.
if(!himg) {
  LTIMING("Image Alpha create");
  BitmapInfo32__ bi(sz.cx, sz.cy);
  himg = CreateDIBSection(ScreenHDC(), bi, DIB_RGB_COLORS, (void **)&section, NULL, 0);
  ASSERT(himg); // Assert on debug
  if(!himg) {
   return; // Return on release.
  }
  Copy(section, ~img, img.GetLength());
}



Re: Rare bug on CtrlCore/ImageWin32.cpp [message #46203 is a reply to message #46058] Fri, 25 March 2016 19:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
While I never met this issue and therefore believe that there is some other cause to the problem, this patch is not going to hurt anything, so accepted...
Previous Topic: Ultimate.... in tab bar of browser
Next Topic: Bug+solution in TheIde Topic++
Goto Forum:
  


Current Time: Fri Mar 29 10:29:53 CET 2024

Total time taken to generate the page: 0.01397 seconds