]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mimecmn.cpp
some != NULL checks
[wxWidgets.git] / src / common / mimecmn.cpp
index dc28cce7a5f866585bf37d96dfe49a62ccc99478..25a0eedb2817b8b6ccda581e9b4a2893319bcd5d 100644 (file)
@@ -15,6 +15,7 @@
 
 // for compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
+#include "wx/module.h"
 
 #ifdef __BORLANDC__
   #pragma hdrstop
@@ -341,6 +342,29 @@ static wxMimeTypesManager gs_mimeTypesManager;
 wxMimeTypesManager * wxTheMimeTypesManager = &gs_mimeTypesManager;
 
 
+
+
+
+class wxMimeTypeCmnModule: public wxModule
+{
+DECLARE_DYNAMIC_CLASS(wxMimeTypeCmnModule)
+public:
+    wxMimeTypeCmnModule() : wxModule() {}
+    bool OnInit() { return TRUE; }
+    void OnExit() 
+    {   // this avoids false memory leak allerts:
+        if (gs_mimeTypesManager.m_impl != NULL)
+       {
+           delete gs_mimeTypesManager.m_impl;
+           gs_mimeTypesManager.m_impl = NULL;
+       }
+    }
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule)
+
+
+
 #endif
   // wxUSE_FILE && wxUSE_TEXTFILE