TestFrame::~TestFrame() { while ( m_nPush-- != 0 ) { PopEventHandler(true /* delete handler */); } }
MyFrame::~MyFrame() { // we must pop any remaining event handlers to avoid memory leaks and // crashes! while ( m_nPush-- != 0 ) { PopEventHandler(true /* delete handler */); } }
void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event)) { wxCHECK_RET( m_nPush, wxT("this command should be disabled!") ); PopEventHandler(true /* delete handler */); m_nPush--; #if wxUSE_STATUSBAR SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push); #endif // wxUSE_STATUSBAR }
DialogsProvider::~DialogsProvider() { WindowSettings *ws = p_intf->p_sys->p_window_settings; #define UPDATE(id,w) \ { \ if( w && w->IsShown() && !w->IsIconized() ) \ ws->SetSettings( WindowSettings::id, true, \ w->GetPosition(), w->GetSize() ); \ else \ ws->SetSettings( WindowSettings::id, false ); \ } UPDATE( ID_PLAYLIST, p_playlist_dialog ); UPDATE( ID_MESSAGES, p_messages_dialog ); UPDATE( ID_FILE_INFO, p_fileinfo_dialog ); UPDATE( ID_BOOKMARKS, p_bookmarks_dialog ); #undef UPDATE PopEventHandler(true); /* Clean up */ if( p_open_dialog ) delete p_open_dialog; if( p_prefs_dialog ) p_prefs_dialog->Destroy(); if( p_file_dialog ) delete p_file_dialog; if( p_playlist_dialog ) delete p_playlist_dialog; if( p_messages_dialog ) delete p_messages_dialog; if( p_fileinfo_dialog ) delete p_fileinfo_dialog; if( p_file_generic_dialog ) delete p_file_generic_dialog; if( p_wizard_dialog ) delete p_wizard_dialog; if( p_bookmarks_dialog ) delete p_bookmarks_dialog; if( p_updatevlc_dialog ) delete p_updatevlc_dialog; if( p_vlm_dialog ) delete p_vlm_dialog; if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon; /* We must set this here because on win32 this destructor will be * automatically called so we must not call it again on wxApp->OnExit(). * There shouldn't be any race conditions as all this should be done * from the same thread. */ p_intf->p_sys->p_wxwindow = NULL; }
frmDebugger::~frmDebugger() { // Only save the settings if the window was completely setup // This may not be the case if the params dialog was displayed, // and the user hit cancel before the main form opened. wxAuiPaneInfo &pane = m_manager.GetPane(wxT("sourcePane")); if (pane.IsOk()) settings->Write(wxT("Debugger/frmDebugger/Perspective-") + wxString(FRMDEBUGGER_PERSPECTIVE_VER), m_manager.SavePerspective()); m_manager.UnInit(); if (m_parent) m_parent->RemoveFrame(this); if (m_controller) { PopEventHandler(); delete m_controller; m_controller = NULL; } }
void wxGISApplication::OnToolDropDown(wxAuiToolBarEvent& event) { if(event.IsDropDownClicked()) { wxGISCommand* pCmd = GetCommand(event.GetToolId()); m_pDropDownCommand = dynamic_cast<IDropDownCommand*>(pCmd); if(m_pDropDownCommand) { wxMenu* pMenu = m_pDropDownCommand->GetDropDownMenu(); if(pMenu) { PushEventHandler(pMenu); PopupMenu(pMenu, event.GetItemRect().GetBottomLeft()); PopEventHandler(); delete pMenu; return; } } } event.Skip(); }
PqwxFrame::~PqwxFrame() { objectBrowserModelTimer->Stop(); delete objectBrowserModelTimer; PopEventHandler(false); }
MyChild::~MyChild() { PopEventHandler(true); ms_numChildren--; }