]> git.saurik.com Git - wxWidgets.git/commitdiff
Mem leaks in connection with print factory code.
authorRobert Roebling <robert@roebling.de>
Fri, 5 Nov 2004 21:33:27 +0000 (21:33 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 5 Nov 2004 21:33:27 +0000 (21:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/appcmn.cpp
src/common/cmndata.cpp

index 43bd65360c435fb67795c90a7916f45ae2f77108..0c15d2a85d8f82aab4491087806113b5d95f1eb0 100644 (file)
@@ -46,6 +46,7 @@
 #include "wx/thread.h"
 #include "wx/utils.h"
 #include "wx/ptr_scpd.h"
 #include "wx/thread.h"
 #include "wx/utils.h"
 #include "wx/ptr_scpd.h"
+#include "wx/prntbase.h"
 
 #if defined(__WXMSW__) && !defined(__PALMOS__)
   #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
 
 #if defined(__WXMSW__) && !defined(__PALMOS__)
   #include  "wx/msw/private.h"  // includes windows.h for LOGFONT
@@ -139,6 +140,8 @@ void wxAppBase::CleanUp()
         // but we want to delete them now
         delete wxTopLevelWindows.GetFirst()->GetData();
     }
         // but we want to delete them now
         delete wxTopLevelWindows.GetFirst()->GetData();
     }
+    
+    wxPrintFactory::SetPrintFactory( NULL );
 
     // undo everything we did in Initialize() above
     wxBitmap::CleanUpHandlers();
 
     // undo everything we did in Initialize() above
     wxBitmap::CleanUpHandlers();
index 3652abefa9cefc70a98173b4058c31b4552d875c..dc13526103b334cfbf6521402ff5cfb0843fe9d4 100644 (file)
@@ -237,7 +237,12 @@ void wxPrintData::operator=(const wxPrintData& data)
     m_bin = data.m_bin;
     m_printMode = data.m_printMode;
     m_filename = data.m_filename;   
     m_bin = data.m_bin;
     m_printMode = data.m_printMode;
     m_filename = data.m_filename;   
-    
+
+    // UnRef old m_nativeData    
+    m_nativeData->m_ref--;
+    if (m_nativeData->m_ref == 0) 
+        delete m_nativeData;
+    // Set Ref new one
     m_nativeData = data.GetNativeData();
     m_nativeData->m_ref++;
     
     m_nativeData = data.GetNativeData();
     m_nativeData->m_ref++;