summaryrefslogtreecommitdiff
path: root/src/terminal-tab-label.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-09-28 21:05:46 +0300
committermonsta <[email protected]>2016-09-28 21:05:46 +0300
commit448be7a26fc1c525d467a9e39a54533b1c262582 (patch)
tree23b97589e006f7e2f905cc0626acb8308bc4b852 /src/terminal-tab-label.c
parent8fdadba38082465cc9cf2df5e9af5436190240c6 (diff)
downloadmate-terminal-448be7a26fc1c525d467a9e39a54533b1c262582.tar.bz2
mate-terminal-448be7a26fc1c525d467a9e39a54533b1c262582.tar.xz
fix crash after detaching tab and then changing its title
fixes https://github.com/mate-desktop/mate-terminal/issues/131 thanks to @egmontkob for the patch: https://git.gnome.org/browse/gnome-terminal/commit/?id=f65261a0b5d03658be3acb439976fd8af6fa28ea
Diffstat (limited to 'src/terminal-tab-label.c')
-rw-r--r--src/terminal-tab-label.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.c
index e5c252a..1aac1e1 100644
--- a/src/terminal-tab-label.c
+++ b/src/terminal-tab-label.c
@@ -151,6 +151,23 @@ terminal_tab_label_constructor (GType type,
}
static void
+terminal_tab_label_dispose (GObject *object)
+{
+ TerminalTabLabel *tab_label = TERMINAL_TAB_LABEL (object);
+ TerminalTabLabelPrivate *priv = tab_label->priv;
+
+ if (priv->screen != NULL) {
+ g_signal_handlers_disconnect_by_func (priv->screen,
+ G_CALLBACK (sync_tab_label),
+ priv->label);
+ g_object_unref (priv->screen);
+ priv->screen = NULL;
+ }
+
+ G_OBJECT_CLASS (terminal_tab_label_parent_class)->dispose (object);
+}
+
+static void
terminal_tab_label_finalize (GObject *object)
{
// TerminalTabLabel *tab_label = TERMINAL_TAB_LABEL (object);
@@ -170,7 +187,7 @@ terminal_tab_label_set_property (GObject *object,
switch (prop_id)
{
case PROP_SCREEN:
- priv->screen = g_value_get_object (value);
+ priv->screen = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -185,6 +202,7 @@ terminal_tab_label_class_init (TerminalTabLabelClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gobject_class->constructor = terminal_tab_label_constructor;
+ gobject_class->dispose = terminal_tab_label_dispose;
gobject_class->finalize = terminal_tab_label_finalize;
gobject_class->set_property = terminal_tab_label_set_property;