]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/menucmn.cpp
fixing overrelease and out-of-bounds write, fixes #13725
[wxWidgets.git] / src / common / menucmn.cpp
index 9f7d8128c5df28a21b51be8e008059ed7d69e8f8..f34a5bf0f6b43ce247da9a2c2a136f7fcfd9e0f8 100644 (file)
@@ -614,7 +614,7 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source)
         {
             wxWindowID itemid = item->GetId();
             wxUpdateUIEvent event(itemid);
-            event.SetEventObject( source );
+            event.SetEventObject( this );
 
             if ( source->ProcessEvent(event) )
             {
@@ -1038,18 +1038,13 @@ wxString wxMenuBarBase::GetHelpString(int itemid) const
 
 void wxMenuBarBase::UpdateMenus()
 {
-    wxEvtHandler* source;
     wxMenu* menu;
     int nCount = GetMenuCount();
     for (int n = 0; n < nCount; n++)
     {
         menu = GetMenu( n );
         if (menu != NULL)
-        {
-            source = menu->GetEventHandler();
-            if (source != NULL)
-                menu->UpdateUI( source );
-        }
+            menu->UpdateUI( NULL );
     }
 }