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:
committed by
Vadim Zeitlin
parent
18d56818f5
commit
413c05ea85
@@ -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 );
|
||||
|
Reference in New Issue
Block a user