]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cmndata.cpp
Correct mistakes in wxStripExtension - correct wxString::npos. Spurred by 1073642...
[wxWidgets.git] / src / common / cmndata.cpp
index 39e55667e6cc21c6fa3c50a3c16c7535cddbcad7..37e2d98304849dc8c2b390cbece5cb6c44bcbfe5 100644 (file)
@@ -190,6 +190,7 @@ wxPrintData::wxPrintData()
 wxPrintData::wxPrintData(const wxPrintData& printData)
     : wxObject()
 {
+    m_nativeData = NULL;
     (*this) = printData;
 }
 
@@ -237,10 +238,13 @@ void wxPrintData::operator=(const wxPrintData& data)
     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;
+    // UnRef old m_nativeData   
+    if (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++;