git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12833
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
bool wxLoadIntoBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette **pal)
{
bool wxLoadIntoBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette **pal)
{
- HBITMAP hBitmap;
- HPALETTE hPalette;
+ HBITMAP hBitmap = NULL;
+ HPALETTE hPalette = NULL;
bool success = (wxReadDIB(filename, &hBitmap, &hPalette) != 0);
if (!success)
{
bool success = (wxReadDIB(filename, &hBitmap, &hPalette) != 0);
if (!success)
{
- DeleteObject(hPalette);
+ if (hPalette)
+ DeleteObject(hPalette);