[libpeas] Assert that the plugin loaders are actually freed on shutdown



commit aa7941ccba50b75e4c7a6be1acc57a6ae9113f0f
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue Nov 12 22:47:56 2013 -0800

    Assert that the plugin loaders are actually freed on shutdown
    
    Useful to know that no extra refs are hanging around.

 libpeas/peas-engine.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 99cf159..684cea3 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -319,7 +319,13 @@ loader_destroy (LoaderInfo *info)
     return;
 
   if (info->loader)
-    g_object_unref (info->loader);
+    {
+      g_object_add_weak_pointer (G_OBJECT (info->loader),
+                                 (gpointer *) &info->loader);
+
+      g_object_unref (info->loader);
+      g_assert (info->loader == NULL);
+    }
 
   g_free (info);
 }


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