]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcmemory.cpp
correcting CGImage handling to be always correctly initialized and freed on OSX build...
[wxWidgets.git] / src / gtk / dcmemory.cpp
index 3c843eae1d342557848118e6f5ee998248d8e703..c6ecf57072547a953a6caa28045150d8c1066a28 100644 (file)
@@ -7,9 +7,8 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "dcmemory.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #include "wx/dcmemory.h"
 
@@ -51,6 +50,9 @@ wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
 
 wxMemoryDC::~wxMemoryDC()
 {
+#ifdef __WXGTK20__
+    g_object_unref(m_context);
+#endif
 }
 
 void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
@@ -68,6 +70,10 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
             m_window = m_selected.GetBitmap();
         }
 
+#ifdef __WXGTK20__
+        m_selected.PurgeOtherRepresentations(wxBitmap::Pixmap);
+#endif
+
         m_isMemDC = TRUE;
 
         SetUpDC();