]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1207202 ] [wxMSW] Fixes GDI leak in cursor
authorJulian Smart <julian@anthemion.co.uk>
Mon, 30 May 2005 08:34:56 +0000 (08:34 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 30 May 2005 08:34:56 +0000 (08:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/cursor.cpp

index 45a3edbfb795812c5edae806f4e201c246e0bae3..41120c1fc37725bddc5b0859e432bf663366b289 100644 (file)
@@ -202,13 +202,13 @@ wxCursor::wxCursor(const wxImage& image)
     }
     else if ((w != image_w) || (h != image_h))
     {
-        hotSpotX = int(hotSpotX * double(w) / double(image_w)); 
-        hotSpotY = int(hotSpotY * double(h) / double(image_h)); 
+        hotSpotX = int(hotSpotX * double(w) / double(image_w));
+        hotSpotY = int(hotSpotY * double(h) / double(image_h));
 
         imageSized = image.Scale(w, h);
     }
 
-    HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized), 
+    HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized),
                                          hotSpotX, hotSpotY );
 
     if ( !hcursor )
@@ -357,7 +357,8 @@ wxCursor::wxCursor(int idCursor)
     }
     else
     {
-        m_refData = new wxCursorRefData(hcursor);
+        m_refData = new wxCursorRefData(hcursor,
+                                        !stdCursor.isStd /* delete it later */);
     }
 }