[gedit/gnome-3-18] Prevent a crash with GeditStatusMenuButton
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/gnome-3-18] Prevent a crash with GeditStatusMenuButton
- Date: Thu, 10 Dec 2015 13:34:21 +0000 (UTC)
commit 08e179e5b8cd5cfbcd69367f19e1f54473e7c92e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Dec 10 13:57:44 2015 +0100
Prevent a crash with GeditStatusMenuButton
The problem is not fixed at the source (in GeditWindow). But at least it
will not crash anymore.
GeditWindow dives deep in the containment hierarchy and connects to some
GeditDocument signals. And it seems that a signal is not correctly
disconnected and is called when GeditWindow is disposed. The code in
GeditWindow is messy and there are other problems (getting the buffer
with gtk_text_view_get_buffer() can return another buffer than the one
that the signal was connected to, especially during destroys).
https://bugzilla.gnome.org/show_bug.cgi?id=759174
gedit/gedit-status-menu-button.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-status-menu-button.c b/gedit/gedit-status-menu-button.c
index 2cfd9bf..dbc5dd6 100644
--- a/gedit/gedit-status-menu-button.c
+++ b/gedit/gedit-status-menu-button.c
@@ -150,12 +150,16 @@ void
gedit_status_menu_button_set_label (GeditStatusMenuButton *button,
const gchar *label)
{
+ g_return_if_fail (GEDIT_IS_STATUS_MENU_BUTTON (button));
+
gtk_label_set_markup (GTK_LABEL (button->label), label);
}
const gchar *
gedit_status_menu_button_get_label (GeditStatusMenuButton *button)
{
+ g_return_val_if_fail (GEDIT_IS_STATUS_MENU_BUTTON (button), NULL);
+
return gtk_label_get_label (GTK_LABEL (button->label));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]