Always free errors while loading images
This commit is contained in:
parent
e2ae426b0c
commit
33f2939cbe
|
@ -2209,17 +2209,17 @@ static void _on_preferences_update_preview(gpointer data)
|
||||||
pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 96,
|
pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 96,
|
||||||
96 / ratio, &error);
|
96 / ratio, &error);
|
||||||
#endif
|
#endif
|
||||||
|
if(error != NULL)
|
||||||
|
{
|
||||||
|
desktop_error(NULL, error->message, 1);
|
||||||
|
g_error_free(error);
|
||||||
|
}
|
||||||
if(pixbuf != NULL)
|
if(pixbuf != NULL)
|
||||||
{
|
{
|
||||||
gtk_image_set_from_pixbuf(GTK_IMAGE(widget), pixbuf);
|
gtk_image_set_from_pixbuf(GTK_IMAGE(widget), pixbuf);
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
active = TRUE;
|
active = TRUE;
|
||||||
}
|
}
|
||||||
else if(error != NULL)
|
|
||||||
{
|
|
||||||
desktop_error(NULL, error->message, 1);
|
|
||||||
g_error_free(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
gtk_file_chooser_set_preview_widget_active(chooser, active);
|
gtk_file_chooser_set_preview_widget_active(chooser, active);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user