]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed memory leaks
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 2 Feb 2000 21:18:02 +0000 (21:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 2 Feb 2000 21:18:02 +0000 (21:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/unix/mimetype.h
src/unix/mimetype.cpp

index 3b9bcab6cd72d4b772bca1b05aeec6ca33d330e6..3b7f478fd4fd525c4c891b2bd3f46bbff8c302bd 100644 (file)
@@ -36,6 +36,8 @@ public:
     // ctor loads all info into memory for quicker access later on
     // TODO it would be nice to load them all, but parse on demand only...
     wxMimeTypesManagerImpl();
+    ~wxMimeTypesManagerImpl();
+    
 
     // implement containing class functions
     wxFileType *GetFileTypeFromExtension(const wxString& ext);
index 3e74741551d805a62cfbd2d560270455388a8d1c..fb55217c0c62ef3e6424029e96365bdc299252f0 100644 (file)
@@ -138,6 +138,11 @@ public:
     {
         m_next = NULL;
     }
+    
+    ~MailCapEntry()
+    {
+        if (m_next) delete m_next;
+    }
 
     // accessors
     const wxString& GetOpenCmd()  const { return m_openCmd;  }
@@ -1041,6 +1046,14 @@ wxMimeTypesManagerImpl::wxMimeTypesManagerImpl()
         handlers[hn]->GetMimeInfoRecords(this);
 }
 
+
+wxMimeTypesManagerImpl::~wxMimeTypesManagerImpl()
+{
+    size_t cnt = m_aEntries.GetCount();
+    for (size_t i = 0; i < cnt; i++) delete m_aEntries[i];
+}
+
+
 wxFileType *
 wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext)
 {