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 previous 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());
}



 
Read Message
Read Message
Previous Topic: Ultimate.... in tab bar of browser
Next Topic: Bug+solution in TheIde Topic++
Goto Forum:
  


Current Time: Sun Apr 28 21:08:48 CEST 2024

Total time taken to generate the page: 0.04823 seconds