]> git.saurik.com Git - wxWidgets.git/commitdiff
Added destructor to fix crash on Mac due to focus event causing
authorJulian Smart <julian@anthemion.co.uk>
Sat, 16 Apr 2005 11:07:30 +0000 (11:07 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 16 Apr 2005 11:07:30 +0000 (11:07 +0000)
text control to be accessed while being deleted

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/datectrl.h
src/generic/datectlg.cpp

index 4b3eb201ca9c1bf5da9a41abd7fd3843b1e7535c..4dac18355ad7d148e715c56d7382dd038d53f53c 100644 (file)
@@ -26,6 +26,7 @@ class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase
 public:
     // creating the control
     wxDatePickerCtrlGeneric() { Init(); }
+    ~wxDatePickerCtrlGeneric() ;
     wxDatePickerCtrlGeneric(wxWindow *parent,
                             wxWindowID id,
                             const wxDateTime& date = wxDefaultDateTime,
index d2feb04557020798e0e827ec2f905177621226fe..a8f65fe98164167b96a9fab02ab271064f92ac64 100644 (file)
@@ -521,6 +521,13 @@ void wxDatePickerCtrlGeneric::Init()
     m_ignoreDrop = false;
 }
 
+wxDatePickerCtrlGeneric::~wxDatePickerCtrlGeneric()
+{
+    m_popup = NULL;
+    m_txt = NULL;
+    m_cal = NULL;
+    m_btn = NULL;
+}
 
 bool wxDatePickerCtrlGeneric::Destroy()
 {
@@ -820,6 +827,9 @@ void wxDatePickerCtrlGeneric::OnSetFocus(wxFocusEvent& WXUNUSED(ev))
 
 void wxDatePickerCtrlGeneric::OnKillFocus(wxFocusEvent &ev)
 {
+    if (!m_txt)
+        return;
+    
     ev.Skip();
 
     wxDateTime dt;