Add a corresponding PopEventHandler call for each PushEventHandler call, this fixes a couple of memory leaks reported by valgrind and msvc.

Originally committed to SVN as r2950.
This commit is contained in:
harukalover 2009-05-18 05:33:49 +00:00
parent f1bfb947cf
commit 9891c28977
3 changed files with 14 additions and 0 deletions

View file

@ -228,6 +228,10 @@ wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISE
//////////////
// Destructor
AudioBox::~AudioBox() {
audioScroll->PopEventHandler(true);
HorizontalZoom->PopEventHandler(true);
VerticalZoom->PopEventHandler(true);
VolumeBar->PopEventHandler(true);
}

View file

@ -223,6 +223,15 @@ SubsEditBox::SubsEditBox (wxWindow *parent,SubtitlesGrid *gridp) : wxPanel(paren
}
//////////////
// Destructor
SubsEditBox::~SubsEditBox() {
ActorBox->PopEventHandler(true);
Effect->PopEventHandler(true);
TextEdit->PopEventHandler(true);
}
/////////////////////////////////
// Set split or single line mode
void SubsEditBox::SetSplitLineMode(wxSize newSize) {

View file

@ -149,6 +149,7 @@ public:
SubsTextEditCtrl *TextEdit;
SubsEditBox(wxWindow *parent,SubtitlesGrid *gridp);
~SubsEditBox();
void SetOverride (wxString tag,wxString preValue=_T(""),int pos=-1,bool getFocus=true);
void SetStyleFlag (wxString tag,wxString preValue=_T(""),int pos=-1);