From 1dddf8389fef10a535dbcc96f5323799a852ade8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 2 Nov 1999 15:57:07 +0000 Subject: [PATCH] bug in wxMenuBase::FindChildItem() corrected git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/menucmn.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 33ccd66f39..6c2e5631a7 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -301,9 +301,12 @@ wxMenuItem *wxMenuBase::FindChildItem(int id, size_t *ppos) const size_t pos; for ( pos = 0; node; pos++ ) { - item = node->GetData(); - if ( item->GetId() == id ) + if ( node->GetData()->GetId() == id ) + { + item = node->GetData(); + break; + } node = node->GetNext(); }