diff options
author | Benjamin Otte <otte@redhat.com> | 2015-03-18 18:22:17 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-03-18 18:24:45 +0100 |
commit | ec57c6c10b3a0774a27e11a9279a25b90ce76ed4 (patch) | |
tree | 2bf1d0b3c87a525c1034fcc2cfbd471a786ca517 /testsuite | |
parent | d55c261079370e3ddd61f3dab6bea9067380480e (diff) | |
download | gtk+-ec57c6c10b3a0774a27e11a9279a25b90ce76ed4.tar.gz |
csspathnode: Handle context going away
Sometimes path nodes can survive longer than the style context that
created them. Don't crash in those cases.
Fixes startup of mutter.
Testcase included.
https://bugzilla.gnome.org/show_bug.cgi?id=746407
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gtk/stylecontext.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/gtk/stylecontext.c b/testsuite/gtk/stylecontext.c index fcbc0a1612..4d6438cb33 100644 --- a/testsuite/gtk/stylecontext.c +++ b/testsuite/gtk/stylecontext.c @@ -352,6 +352,20 @@ test_set_widget_path_saved (void) g_object_unref (context); } +void +test_widget_path_parent (void) +{ + GtkStyleContext *parent, *context; + + parent = gtk_style_context_new (); + context = gtk_style_context_new (); + + gtk_style_context_set_parent (context, parent); + + g_object_unref (parent); + g_object_unref (context); +} + int main (int argc, char *argv[]) { @@ -364,6 +378,7 @@ main (int argc, char *argv[]) g_test_add_func ("/style/basic", test_basic_properties); g_test_add_func ("/style/invalidate-saved", test_invalidate_saved); g_test_add_func ("/style/set-widget-path-saved", test_set_widget_path_saved); + g_test_add_func ("/style/widget-path-parent", test_widget_path_parent); return g_test_run (); } |