[gnome-software] trivial: Add in some more asserts to debug a refcounting bug



commit 93e082d06ab4414fcf607e8826bead0a77a9b5f3
Author: Richard Hughes <richard hughsie com>
Date:   Tue Oct 8 17:59:40 2013 +0100

    trivial: Add in some more asserts to debug a refcounting bug

 src/gs-app.c           |    1 +
 src/gs-plugin-loader.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index b859295..4be8b5d 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -497,6 +497,7 @@ void
 gs_app_set_pixbuf (GsApp *app, GdkPixbuf *pixbuf)
 {
        g_return_if_fail (GS_IS_APP (app));
+       g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
        if (app->priv->pixbuf != NULL)
                g_object_unref (app->priv->pixbuf);
        app->priv->pixbuf = g_object_ref (pixbuf);
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 3fdb222..facbb6a 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -88,6 +88,9 @@ gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader, GsApp *app)
        GsApp *new_app;
        GsPluginLoaderPrivate *priv = plugin_loader->priv;
 
+       g_return_val_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader), NULL);
+       g_return_val_if_fail (GS_IS_APP (app), NULL);
+
        g_mutex_lock (&plugin_loader->priv->app_cache_mutex);
 
        /* not yet set */


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