]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
Fix the use of AutoHBITMAP in recently added LoadImageFromResource().
[wxWidgets.git] / src / common / image.cpp
index a3a5f0ada6377f4dbd84b89afec7ba1a5d85dd24..5d65ecaa9cb44c186100eaf6ce1af0111104b39c 100644 (file)
@@ -2254,7 +2254,7 @@ static wxImage LoadImageFromResource(const wxString &name, wxBitmapType type)
 
     if ( type == wxBITMAP_TYPE_BMP_RESOURCE )
     {
-        hBitmap = ::LoadBitmap(wxGetInstance(), name.t_str());
+        hBitmap.Init( ::LoadBitmap(wxGetInstance(), name.t_str()) );
 
         if ( !hBitmap )
         {
@@ -2278,8 +2278,8 @@ static wxImage LoadImageFromResource(const wxString &name, wxBitmapType type)
                 return wxImage();
             }
 
-            hBitmap = info.hbmColor;
-            hMask   = info.hbmMask;
+            hBitmap.Init(info.hbmColor);
+            hMask.Init(info.hbmMask);
         }
     }
     else if ( type == wxBITMAP_TYPE_CUR_RESOURCE )