[gimp] Issue #6142: plugin crash exporting as jpg.



commit c21859ebc4f70f6a563b7c04f70c2beeb3905f6c
Author: Jehan <jehan girinstud io>
Date:   Sat Dec 26 07:22:52 2020 +0100

    Issue #6142: plugin crash exporting as jpg.
    
    This issue is happening on all 4 plug-ins using the new API, it would
    seem, but only on Windows.
    Looking at stack trace, I believe we might simply be freeing a mutex
    twice because dispose() is allowed to be called several times. Let's
    make this finalize() code instead (the data freeing we do there looks
    much more adapted for finalize() anyway).

 libgimp/gimpsaveproceduredialog.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/libgimp/gimpsaveproceduredialog.c b/libgimp/gimpsaveproceduredialog.c
index d97e86076a..e7c4ec8018 100644
--- a/libgimp/gimpsaveproceduredialog.c
+++ b/libgimp/gimpsaveproceduredialog.c
@@ -41,7 +41,7 @@ struct _GimpSaveProcedureDialogPrivate
 };
 
 
-static void   gimp_save_procedure_dialog_dispose   (GObject             *object);
+static void   gimp_save_procedure_dialog_finalize  (GObject             *object);
 
 static void   gimp_save_procedure_dialog_fill_list (GimpProcedureDialog *dialog,
                                                     GimpProcedure       *procedure,
@@ -66,7 +66,7 @@ gimp_save_procedure_dialog_class_init (GimpSaveProcedureDialogClass *klass)
   object_class      = G_OBJECT_CLASS (klass);
   proc_dialog_class = GIMP_PROCEDURE_DIALOG_CLASS (klass);
 
-  object_class->dispose        = gimp_save_procedure_dialog_dispose;
+  object_class->finalize       = gimp_save_procedure_dialog_finalize;
   proc_dialog_class->fill_list = gimp_save_procedure_dialog_fill_list;
 }
 
@@ -82,16 +82,15 @@ gimp_save_procedure_dialog_init (GimpSaveProcedureDialog *dialog)
 }
 
 static void
-gimp_save_procedure_dialog_dispose (GObject *object)
+gimp_save_procedure_dialog_finalize (GObject *object)
 {
   GimpSaveProcedureDialog *dialog = GIMP_SAVE_PROCEDURE_DIALOG (object);
 
   g_list_free_full (dialog->priv->additional_metadata, g_free);
-  dialog->priv->additional_metadata = NULL;
   g_clear_pointer (&dialog->priv->metadata_thread, g_thread_unref);
   g_mutex_clear (&dialog->priv->metadata_thread_mutex);
 
-  G_OBJECT_CLASS (parent_class)->dispose (object);
+  G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]