font button: Fix a crash
authorMatthias Clasen <mclasen@redhat.com>
Mon, 2 Apr 2018 21:45:48 +0000 (17:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 2 Apr 2018 21:45:48 +0000 (17:45 -0400)
Since we are now storing the language as a PangoLanguage,
we must not free it anymore.

gtk/gtkfontbutton.c

index 6c06029bf866a824e9c99f4e4a60ba6238d7c6b7..21c244681e59e2afa8208a0aedf017284cba3a95 100644 (file)
@@ -1005,8 +1005,7 @@ response_cb (GtkDialog *dialog,
   priv->font_size = gtk_font_chooser_get_font_size (font_chooser);
   g_free (priv->font_features);
   priv->font_features = gtk_font_chooser_get_font_features (font_chooser);
-  g_free (priv->language);
-  priv->language = gtk_font_chooser_get_language (font_chooser);
+  priv->language = pango_language_from_string (gtk_font_chooser_get_language (font_chooser));
 
   /* Set label font */
   gtk_font_button_update_font_info (font_button);