]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix of memory leak with generic file dialog (Patch #1017938)
authorWłodzimierz Skiba <abx@abx.art.pl>
Tue, 31 Aug 2004 12:44:38 +0000 (12:44 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Tue, 31 Aug 2004 12:44:38 +0000 (12:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/filedlgg.cpp

index 47c1419984d96489d0f9fc9a82f9dc6533a25e36..d50dfad560ad3bec31c2e56ee108ec81f8bcfede 100644 (file)
@@ -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();
 }
 
 //-----------------------------------------------------------------------------