]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dirdlg.cpp
Fix editing support.
[wxWidgets.git] / src / gtk / dirdlg.cpp
index 18628f6086c576ee63beaa055bbc526d2c3a895f..84f672f95dd48d68e0eebe9bae8cf28d48753328 100644 (file)
@@ -167,7 +167,7 @@ wxDirDialog::wxDirDialog(wxWindow* parent, const wxString& title,
 void wxDirDialog::OnFakeOk( wxCommandEvent &event )
 {
     if (!gtk_check_version(2,4,0))
-        wxDialog::OnOK( event );
+        EndDialog(wxID_OK);
     else
         wxGenericDirDialog::OnOK( event );
 }
@@ -212,7 +212,13 @@ void wxDirDialog::SetPath(const wxString& dir)
 wxString wxDirDialog::GetPath() const
 {
     if (!gtk_check_version(2,4,0))
-        return wxConvFileName->cMB2WX( gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(m_widget) ) );
+    {
+        gchar *str = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(m_widget) );
+        wxString ret = wxConvFileName->cMB2WX(str);
+        if (str) g_free(str);
+
+        return ret;
+    }
     else
         return wxGenericDirDialog::GetPath();
 }