Hold a reference on m_widget for the life of the associated wxWindow object.
This allows removing some ugly hacks, and leaking of GtkWidgets by wxNotebook. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -140,6 +140,8 @@ void wxMessageDialog::GTKCreateMsgDialog()
|
||||
#endif // GTK+ 2.6+
|
||||
#endif // wxUSE_LIBHILDON/!wxUSE_LIBHILDON
|
||||
|
||||
g_object_ref(m_widget);
|
||||
|
||||
if (m_caption != wxMessageBoxCaptionStr)
|
||||
gtk_window_set_title(GTK_WINDOW(m_widget), wxGTK_CONV(m_caption));
|
||||
|
||||
@@ -204,6 +206,7 @@ int wxMessageDialog::ShowModal()
|
||||
|
||||
gint result = gtk_dialog_run(GTK_DIALOG(m_widget));
|
||||
gtk_widget_destroy(m_widget);
|
||||
g_object_unref(m_widget);
|
||||
m_widget = NULL;
|
||||
|
||||
switch (result)
|
||||
|
||||
Reference in New Issue
Block a user