From 3568774cab3c4ca13af49070d87203ea96adc9bf Mon Sep 17 00:00:00 2001 From: harukalover Date: Fri, 12 Jun 2009 00:04:35 +0000 Subject: [PATCH] Fixed a memory leak that would occur after using any help button Originally committed to SVN as r3050. --- aegisub/src/frame_main.cpp | 1 + aegisub/src/help_button.cpp | 4 ++++ aegisub/src/help_button.h | 1 + 3 files changed, 6 insertions(+) diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index 349c08508..2e4bc43ed 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -585,6 +585,7 @@ void FrameMain::DeInitContents() { delete AssFile::top; delete EditBox; delete videoBox; + HelpButton::ClearPages(); } diff --git a/aegisub/src/help_button.cpp b/aegisub/src/help_button.cpp index 0b054110b..12e58fda8 100644 --- a/aegisub/src/help_button.cpp +++ b/aegisub/src/help_button.cpp @@ -125,3 +125,7 @@ void HelpButton::InitStatic() { page[_T("Visual Typesetting")] = _T("Visual_Typesetting"); } } + +void HelpButton::ClearPages() { + if (pages) delete pages; +} diff --git a/aegisub/src/help_button.h b/aegisub/src/help_button.h index d1e6e5017..505b682ad 100644 --- a/aegisub/src/help_button.h +++ b/aegisub/src/help_button.h @@ -57,4 +57,5 @@ public: HelpButton(wxWindow *parent,wxString page=_T(""),wxPoint position=wxDefaultPosition,wxSize size=wxDefaultSize); static void OpenPage(const wxString page); + static void ClearPages(); };