aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNoam Postavsky2020-05-24 20:14:48 -0400
committerNoam Postavsky2020-05-24 20:14:48 -0400
commit3b65fb7658c2717457c033c6704cf3b007804226 (patch)
tree69d22243585d968bc85f92c5d31fd1c860534e3e /src
parent104b68b670eb6de6614c562ae6b18c009b20584f (diff)
downloademacs-3b65fb7658c2717457c033c6704cf3b007804226.tar.gz
emacs-3b65fb7658c2717457c033c6704cf3b007804226.zip
Fix segfault on closing frame with tooltip (Bug#41239)
* src/gtkutil.c (xg_free_frame_widgets): Empty and unreference the tooltip widget before destroying its label.
Diffstat (limited to 'src')
-rw-r--r--src/gtkutil.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 681f86f51ba..5d1ce6de97c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1404,10 +1404,15 @@ xg_free_frame_widgets (struct frame *f)
1404 FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */ 1404 FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */
1405 FRAME_X_RAW_DRAWABLE (f) = 0; 1405 FRAME_X_RAW_DRAWABLE (f) = 0;
1406 FRAME_GTK_OUTER_WIDGET (f) = 0; 1406 FRAME_GTK_OUTER_WIDGET (f) = 0;
1407 if (x->ttip_widget)
1408 {
1409 /* Remove ttip_lbl from ttip_widget's custom slot before
1410 destroying it, to avoid double-free (Bug#41239). */
1411 gtk_tooltip_set_custom (x->ttip_widget, NULL);
1412 g_object_unref (G_OBJECT (x->ttip_widget));
1413 }
1407 if (x->ttip_lbl) 1414 if (x->ttip_lbl)
1408 gtk_widget_destroy (x->ttip_lbl); 1415 gtk_widget_destroy (x->ttip_lbl);
1409 if (x->ttip_widget)
1410 g_object_unref (G_OBJECT (x->ttip_widget));
1411 } 1416 }
1412} 1417}
1413 1418