Prevent seg fault for older GTK+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
\
|
\
|
||||||
virtual bool Destroy() \
|
virtual bool Destroy() \
|
||||||
{ \
|
{ \
|
||||||
m_dialog->Destroy(); \
|
if (m_dialog) \
|
||||||
|
m_dialog->Destroy(); \
|
||||||
return wxButton::Destroy(); \
|
return wxButton::Destroy(); \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
|
@@ -108,7 +108,8 @@ 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
|
||||||
m_dialog->m_widget = NULL;
|
if (m_dialog)
|
||||||
|
m_dialog->m_widget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFileButton::OnDialogOK(wxCommandEvent& ev)
|
void wxFileButton::OnDialogOK(wxCommandEvent& ev)
|
||||||
@@ -129,7 +130,8 @@ void wxFileButton::OnDialogOK(wxCommandEvent& ev)
|
|||||||
void wxFileButton::SetPath(const wxString &str)
|
void wxFileButton::SetPath(const wxString &str)
|
||||||
{
|
{
|
||||||
m_path = str;
|
m_path = str;
|
||||||
UpdateDialogPath(m_dialog);
|
if (m_dialog)
|
||||||
|
UpdateDialogPath(m_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_FILEPICKERCTRL && defined(__WXGTK26__)
|
#endif // wxUSE_FILEPICKERCTRL && defined(__WXGTK26__)
|
||||||
@@ -255,7 +257,8 @@ 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
|
||||||
m_dialog->m_widget = NULL;
|
if (m_dialog)
|
||||||
|
m_dialog->m_widget = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDirButton::SetPath(const wxString &str)
|
void wxDirButton::SetPath(const wxString &str)
|
||||||
@@ -269,7 +272,8 @@ 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;
|
||||||
|
|
||||||
UpdateDialogPath(m_dialog);
|
if (m_dialog)
|
||||||
|
UpdateDialogPath(m_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_DIRPICKERCTRL && defined(__WXGTK26__)
|
#endif // wxUSE_DIRPICKERCTRL && defined(__WXGTK26__)
|
||||||
|
Reference in New Issue
Block a user