]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix the use of AutoHBITMAP in recently added LoadImageFromResource().
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 1 Jul 2012 11:35:49 +0000 (11:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 1 Jul 2012 11:35:49 +0000 (11:35 +0000)
Assignment operator of AutoHBITMAP doesn't work as expected (and probably
should be removed/fixed), avoid its use by explicitly calling Init().

Closes #14425.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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 )