]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/printdlg.cpp
make sure we don't keep a focus pointer to a window that gets deleted
[wxWidgets.git] / src / mac / printdlg.cpp
index 8f59b0d2e3137b15a565fa9437046fbf582fdb15..ec13b9745533f2553212d8034d8396b6ebe47442 100644 (file)
@@ -18,6 +18,9 @@
 #include "wx/dcprint.h"
 #include "wx/msgdlg.h"
 #include "wx/mac/uma.h"
+#ifndef __DARWIN__
+    #include "Printing.h"
+#endif
 
 #if defined(TARGET_CARBON) && !defined(__DARWIN__)
 #  if PM_USE_SESSION_APIS
@@ -68,8 +71,10 @@ bool wxPrintDialog::Create(wxWindow *p, wxPrintDialogData* data)
 
 wxPrintDialog::~wxPrintDialog()
 {
-    if (m_destroyDC && m_printerDC)
+    if (m_destroyDC && m_printerDC) {
         delete m_printerDC;
+        m_printerDC = NULL;
+    }
 }
 
 int wxPrintDialog::ShowModal()