Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/test/torturetest.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/torturetest.c')
-rw-r--r--test/torturetest.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/torturetest.c b/test/torturetest.c
index 62b8764..694755f 100644
--- a/test/torturetest.c
+++ b/test/torturetest.c
@@ -539,7 +539,7 @@ get_attached_style (GtkStyle *fallback, GdkWindow *window, const gchar *path, GT
style = gtk_rc_get_style_by_paths (settings, path, path, type);
if (!style)
- style = fallback;
+ style = g_object_ref (fallback);
else
g_object_ref (style);
@@ -558,6 +558,18 @@ create_teststyles ()
styles[STYLE_COMBOBOXENTRY] = get_attached_style (window->style, window->window, "GtkWindow.GtkComboBoxEntry.GtkButton", GTK_TYPE_BUTTON);
}
+static void
+destroy_teststyles ()
+{
+ gint i;
+
+ for (i = 0; i < STYLE_COUNT; i++) {
+ gtk_style_detach (styles[i]);
+ g_object_unref (styles[i]);
+ styles[i] = NULL;
+ }
+}
+
int
main (int argc, char **argv)
{
@@ -591,10 +603,12 @@ main (int argc, char **argv)
for (i = 0; i < G_N_ELEMENTS (tests); i++)
run_test (i);
+
+ destroy_teststyles ();
/* remove the rc file again. This should cause an unload of the engine
* and destruction of all engine objects. */
- gtk_rc_set_default_files (new_default_files);
+ gtk_rc_set_default_files (new_default_files);
gtk_rc_reparse_all_for_settings (settings, TRUE);
while (gdk_events_pending ())