Prevent seg fault for older GTK+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
\
|
\
|
||||||
virtual bool Destroy() \
|
virtual bool Destroy() \
|
||||||
{ \
|
{ \
|
||||||
|
if (m_dialog) \
|
||||||
m_dialog->Destroy(); \
|
m_dialog->Destroy(); \
|
||||||
return wxButton::Destroy(); \
|
return wxButton::Destroy(); \
|
||||||
} \
|
} \
|
||||||
|
@@ -105,6 +105,7 @@ wxFileButton::~wxFileButton()
|
|||||||
// GtkFileChooserDialog associated with m_dialog.
|
// GtkFileChooserDialog associated with m_dialog.
|
||||||
// Thus we have to set its m_widget to NULL to avoid
|
// Thus we have to set its m_widget to NULL to avoid
|
||||||
// double destruction on same widget
|
// double destruction on same widget
|
||||||
|
if (m_dialog)
|
||||||
m_dialog->m_widget = NULL;
|
m_dialog->m_widget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +127,7 @@ void wxFileButton::OnDialogOK(wxCommandEvent& ev)
|
|||||||
void wxFileButton::SetPath(const wxString &str)
|
void wxFileButton::SetPath(const wxString &str)
|
||||||
{
|
{
|
||||||
m_path = str;
|
m_path = str;
|
||||||
|
if (m_dialog)
|
||||||
UpdateDialogPath(m_dialog);
|
UpdateDialogPath(m_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,6 +251,7 @@ wxDirButton::~wxDirButton()
|
|||||||
// GtkFileChooserDialog associated with m_dialog.
|
// GtkFileChooserDialog associated with m_dialog.
|
||||||
// Thus we have to set its m_widget to NULL to avoid
|
// Thus we have to set its m_widget to NULL to avoid
|
||||||
// double destruction on same widget
|
// double destruction on same widget
|
||||||
|
if (m_dialog)
|
||||||
m_dialog->m_widget = NULL;
|
m_dialog->m_widget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +266,7 @@ void wxDirButton::SetPath(const wxString &str)
|
|||||||
// general with all wxWidgets control-manipulation functions which do not send events).
|
// general with all wxWidgets control-manipulation functions which do not send events).
|
||||||
m_bIgnoreNextChange = true;
|
m_bIgnoreNextChange = true;
|
||||||
|
|
||||||
|
if (m_dialog)
|
||||||
UpdateDialogPath(m_dialog);
|
UpdateDialogPath(m_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user