Fix wxAcceleratorEntry memory leaks in the menu test

Use wxScopedPtr to ensure that all the test accelerator entries are
destroyed instead of just being leaked.
This commit is contained in:
Ilya Sinitsyn
2020-10-13 10:41:57 +07:00
committed by Vadim Zeitlin
parent 18d56818f5
commit 413c05ea85
2 changed files with 10 additions and 6 deletions

View File

@@ -20,6 +20,7 @@
#endif // WX_PRECOMP
#include "wx/menu.h"
#include "wx/scopedptr.h"
#include "wx/translation.h"
#include "wx/uiaction.h"
@@ -624,7 +625,9 @@ namespace
void VerifyAccelAssigned( wxString labelText, int keycode )
{
wxAcceleratorEntry* entry = wxAcceleratorEntry::Create( labelText );
const wxScopedPtr<wxAcceleratorEntry> entry(
wxAcceleratorEntry::Create( labelText )
);
CHECK( entry );
CHECK( entry->GetKeyCode() == keycode );