]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use a destroy event handler to disconnect the native control's delegate as...
authorKevin Ollivier <kevino@theolliviers.com>
Sun, 3 Jan 2010 23:59:32 +0000 (23:59 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sun, 3 Jan 2010 23:59:32 +0000 (23:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/nonownedwnd.h
src/osx/nonownedwnd_osx.cpp

index da7ede4551c41e3f12c74e01b10a2c9dd25bde5b..eee92a7ea6006f5bcc8794e05b447f12cebb6821 100644 (file)
@@ -103,6 +103,8 @@ public:
     virtual void HandleResized( double timestampsec );
     virtual void HandleMoved( double timestampsec );
     virtual void HandleResizing( double timestampsec, wxRect* rect );
+    
+    virtual bool Destroy();
 
 protected:
     // common part of all ctors
@@ -117,7 +119,7 @@ protected:
                                    wxShowEffect effect,
                                    unsigned timeout);
     
-    void OnWindowDestroy( wxWindowDestroyEvent &event);
+    virtual void WillBeDestroyed();
 
     wxNonOwnedWindowImpl* m_nowpeer ;
 
index 12d8d61aab9248148870d92e23550a44214521a6..017107215f22521e3e247c280e9dc01380018a69 100644 (file)
@@ -147,9 +147,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent,
     if ( parent )
         parent->AddChild(this);
 
-    wxBIND_OR_CONNECT_HACK(this, wxEVT_DESTROY, wxWindowDestroyEventHandler,
-                           wxNonOwnedWindow::OnWindowDestroy, this);
-
     return true;
 }
 
@@ -169,10 +166,15 @@ wxNonOwnedWindow::~wxNonOwnedWindow()
         s_macDeactivateWindow = NULL;
 }
 
-void wxNonOwnedWindow::OnWindowDestroy( wxWindowDestroyEvent &event)
+bool wxNonOwnedWindow::Destroy()
 {
-    event.Skip();
+    WillBeDestroyed();
     
+    return wxWindow::Destroy();
+}
+
+void wxNonOwnedWindow::WillBeDestroyed()
+{
     if ( m_nowpeer )
         m_nowpeer->WillBeDestroyed();
 }