Fix memory leak introduced in r78179: wxMenuItemBase::SetAccel does not take ownership of the passed pointer nor keeps it for later use.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5675ba1e84
commit
9396ae004b
@ -101,11 +101,9 @@ wxObject *wxMenuXmlHandler::DoCreateResource()
|
||||
GetText(wxT("help")), kind);
|
||||
if (!accel.empty())
|
||||
{
|
||||
wxAcceleratorEntry *entry = new wxAcceleratorEntry();
|
||||
if (entry->FromString(accel))
|
||||
mitem->SetAccel(entry);
|
||||
else
|
||||
delete entry;
|
||||
wxAcceleratorEntry entry;
|
||||
if (entry.FromString(accel))
|
||||
mitem->SetAccel(&entry);
|
||||
}
|
||||
|
||||
#if !defined(__WXMSW__) || wxUSE_OWNER_DRAWN
|
||||
|
Loading…
Reference in New Issue
Block a user