app: g_type_class_unref() PixbufStyle in themes_exit().

Massimo is worried that it could unload the module (maybe in some
specific cases?), which could indeed happen when the g_type_class_ref()
just before was the first call to the class (hence it's the only ref).
So let's just unref() in the exit() function instead.
This commit is contained in:
Jehan 2017-12-01 15:54:14 +01:00
parent 0830fe8923
commit ba8dca5f47
1 changed files with 7 additions and 3 deletions

View File

@ -65,7 +65,8 @@ static void themes_draw_layout (GtkStyle *style,
/* private variables */
static GHashTable *themes_hash = NULL;
static GHashTable *themes_hash = NULL;
static gpointer pixbuf_style_type_class = NULL;
/* public functions */
@ -75,7 +76,6 @@ themes_init (Gimp *gimp)
{
GimpGuiConfig *config;
gchar *themerc;
gpointer pixbuf_style_type_class;
g_return_if_fail (GIMP_IS_GIMP (gimp));
@ -91,7 +91,6 @@ themes_init (Gimp *gimp)
if (pixbuf_style_type_class)
{
GTK_STYLE_CLASS (pixbuf_style_type_class)->draw_layout = themes_draw_layout;
g_type_class_unref (pixbuf_style_type_class);
}
config = GIMP_GUI_CONFIG (gimp->config);
@ -182,6 +181,11 @@ themes_exit (Gimp *gimp)
g_hash_table_destroy (themes_hash);
themes_hash = NULL;
}
if (pixbuf_style_type_class)
{
g_type_class_unref (pixbuf_style_type_class);
pixbuf_style_type_class = NULL;
}
}
gchar **