[gimp] app: fix wrong extension active state on exit.



commit 3e0be2046e08317b2cdef278f3e3fdfacc5ba23a
Author: Jehan <jehan girinstud io>
Date:   Thu Oct 8 19:40:12 2020 +0200

    app: fix wrong extension active state on exit.
    
    First the deserialize data of extensionrc was wrong. I need to edit the
    pointer to the GList (and dereference it when I need).
    
    Also when inserting an extension into the `running_extensions` hash
    table, I could not reuse the same string as in the `processed` list
    (because this string is going to be freed at end of initialization).
    Just always use the GimpObject name of the extension, since it will stay
    alive for as long as the object is alive.

 app/core/gimpextensionmanager.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/app/core/gimpextensionmanager.c b/app/core/gimpextensionmanager.c
index 37c00f0822..0c5835ab8c 100644
--- a/app/core/gimpextensionmanager.c
+++ b/app/core/gimpextensionmanager.c
@@ -259,9 +259,9 @@ gimp_extension_manager_deserialize (GimpConfig *config,
                                     gint        nest_level,
                                     gpointer    data)
 {
-  GimpExtensionManager *manager = GIMP_EXTENSION_MANAGER (config);
-  GList                *processed = *(GList**) data;
-  GTokenType            token;
+  GimpExtensionManager  *manager  = GIMP_EXTENSION_MANAGER (config);
+  GList                **processed = (GList**) data;
+  GTokenType             token;
 
   token = G_TOKEN_LEFT_PAREN;
 
@@ -348,7 +348,8 @@ gimp_extension_manager_deserialize (GimpConfig *config,
                         if (gimp_extension_run (list->data, &error))
                           {
                             g_hash_table_insert (manager->p->running_extensions,
-                                                 (gpointer) name, list->data);
+                                                 (gpointer) gimp_object_get_name (list->data),
+                                                 list->data);
                           }
                         else
                           {
@@ -363,7 +364,7 @@ gimp_extension_manager_deserialize (GimpConfig *config,
                 /* Save the list of processed extension IDs, whether
                  * active or not.
                  */
-                processed = g_list_prepend (processed, name);
+                *processed = g_list_prepend (*processed, name);
               }
             else
               {


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