]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/cursor.cpp
fix memory leak (coverity checker CID 53)
[wxWidgets.git] / src / msw / cursor.cpp
index c0e03b7adddc405123a4d084083a5765064e267f..3a6a3e9e80849b49cae25b425bf97ef49f171915 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "cursor.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -40,7 +36,9 @@
 
 #include "wx/module.h"
 #include "wx/image.h"
+
 #include "wx/msw/private.h"
+#include "wx/msw/missing.h" // IDC_HAND
 
 // define functions missing in MicroWin
 #ifdef __WXMICROWIN__
@@ -211,11 +209,15 @@ wxCursor::wxCursor(const wxImage& image)
     HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized),
                                          hotSpotX, hotSpotY );
 
+#if wxUSE_WXDIB
     if ( !hcursor )
     {
         wxLogWarning(_("Failed to create cursor."));
         return;
     }
+#else
+    HCURSOR hcursor = 0;
+#endif                                         
 
     m_refData = new wxCursorRefData(hcursor, true /* delete it later */);
 }