]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/app.cpp
Fix memory leak when a spacer is added, and crash when a window is added before wxSiz...
[wxWidgets.git] / src / gtk1 / app.cpp
index 6b9ddf198c6a8e4242d229ba5a38d8310704624d..dbe83542dc3e0aff07d0cc5960b7df556d4690f5 100644 (file)
@@ -606,6 +606,12 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
         wxConvCurrent = (wxMBConv*) NULL;
 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
 
         wxConvCurrent = (wxMBConv*) NULL;
 #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
 
+#ifdef __WXGTK20__
+    m_convBrokenFileNames = new wxConvBrokenFileNames;
+    m_oldConvFileName = wxConvFileName;
+    wxConvFileName = m_convBrokenFileNames;
+#endif
+
 #if wxUSE_UNICODE
     // gtk_init() wants UTF-8, not wchar_t, so convert
     int i;
 #if wxUSE_UNICODE
     // gtk_init() wants UTF-8, not wchar_t, so convert
     int i;
@@ -680,6 +686,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
 
 void wxApp::CleanUp()
 {
 
 void wxApp::CleanUp()
 {
+#ifdef __WXGTK20__
+    delete m_convBrokenFileNames;
+    wxConvFileName = m_oldConvFileName;
+#endif
+
     gdk_threads_leave();
 
     wxAppBase::CleanUp();
     gdk_threads_leave();
 
     wxAppBase::CleanUp();