From: Włodzimierz Skiba Date: Tue, 31 Aug 2004 12:44:38 +0000 (+0000) Subject: Fix of memory leak with generic file dialog (Patch #1017938) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/118322a3dfcc1803bd13df8193ea1be9ae39e653 Fix of memory leak with generic file dialog (Patch #1017938) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 47c1419984..d50dfad560 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -823,6 +823,10 @@ void wxFileCtrl::SortItems(wxFileData::fileListFieldType field, bool foward) wxFileCtrl::~wxFileCtrl() { + // Normally the data are freed via an EVT_LIST_DELETE_ALL_ITEMS event and + // wxFileCtrl::OnListDeleteAllItems. But if the event is generated after + // the destruction of the wxFileCtrl we need to free any data here: + FreeAllItemsData(); } //-----------------------------------------------------------------------------