Hopefully fixed the damned Script-Fu bug!

--Sven
This commit is contained in:
Sven Neumann
1999-11-02 21:48:53 +00:00
parent b2317dcdb2
commit ebc892e783
3 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,10 @@
Tue Nov 2 22:40:31 MET 1999 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-scripts.c: Fonts aren't free'd after
a gdk_font_load but unref'd of course. I just wonder why this has
ever worked before...
This should fix bugs #2554, #2774, #2798, #2963 and #3209. Whee!
Mon Nov 1 09:28:46 PST 1999 Manish Singh <yosh@gimp.org> Mon Nov 1 09:28:46 PST 1999 Manish Singh <yosh@gimp.org>
* Made 1.1.11 release * Made 1.1.11 release

View File

@ -1516,7 +1516,7 @@ script_fu_font_preview (GtkWidget *preview,
if (font != NULL) if (font != NULL)
{ {
g_free (font); gdk_font_unref (font);
strtok (fontname, "-"); strtok (fontname, "-");
family = strtok (NULL, "-"); family = strtok (NULL, "-");
@ -1605,7 +1605,8 @@ script_fu_ok_callback (GtkWidget *widget,
g_message (_("At least one font you've choosen is invalid.\nPlease check your settings.\n")); g_message (_("At least one font you've choosen is invalid.\nPlease check your settings.\n"));
return; return;
} }
g_free (font); else
gdk_font_unref (font);
} }
length = strlen (script->script_name) + 3; length = strlen (script->script_name) + 3;
@ -2176,7 +2177,6 @@ script_fu_font_dialog_ok (GtkWidget *widget,
font = (SFFont *) data; font = (SFFont *) data;
fontname = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (font->dialog)); fontname = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (font->dialog));
if (fontname != NULL) if (fontname != NULL)
{ {

View File

@ -1516,7 +1516,7 @@ script_fu_font_preview (GtkWidget *preview,
if (font != NULL) if (font != NULL)
{ {
g_free (font); gdk_font_unref (font);
strtok (fontname, "-"); strtok (fontname, "-");
family = strtok (NULL, "-"); family = strtok (NULL, "-");
@ -1605,7 +1605,8 @@ script_fu_ok_callback (GtkWidget *widget,
g_message (_("At least one font you've choosen is invalid.\nPlease check your settings.\n")); g_message (_("At least one font you've choosen is invalid.\nPlease check your settings.\n"));
return; return;
} }
g_free (font); else
gdk_font_unref (font);
} }
length = strlen (script->script_name) + 3; length = strlen (script->script_name) + 3;
@ -2176,7 +2177,6 @@ script_fu_font_dialog_ok (GtkWidget *widget,
font = (SFFont *) data; font = (SFFont *) data;
fontname = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (font->dialog)); fontname = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (font->dialog));
if (fontname != NULL) if (fontname != NULL)
{ {