]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
reverted rev 1.26, workarounds for memchecking code no longer needed
[wxWidgets.git] / src / common / menucmn.cpp
index 3b2c9d37aac659c8df4e8ceaed4f70217cf93537..62118b53b5f87a0ed155f0e3b65e564f72c90b0c 100644 (file)
@@ -537,6 +537,15 @@ wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const
 // window will be used.
 void wxMenuBase::UpdateUI(wxEvtHandler* source)
 {
+    if (GetInvokingWindow())
+    {
+        // Don't update menus if the parent
+        // frame is about to get deleted
+        wxWindow *tlw = wxGetTopLevelParent( GetInvokingWindow() );
+        if (tlw && wxPendingDelete.Member(tlw))
+            return;
+    }
+
     if ( !source && GetInvokingWindow() )
         source = GetInvokingWindow()->GetEventHandler();
     if ( !source )