[gnome-software] trivial: Add two asserts



commit fd192764123d1d62864f94938c3bc39632d4c6a8
Author: Kalev Lember <klember redhat com>
Date:   Mon Sep 28 09:13:21 2015 +0200

    trivial: Add two asserts

 src/gs-app-addon-row.c |    1 +
 src/gs-app-row.c       |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app-addon-row.c b/src/gs-app-addon-row.c
index bce2167..7b0ace1 100644
--- a/src/gs-app-addon-row.c
+++ b/src/gs-app-addon-row.c
@@ -171,6 +171,7 @@ gs_app_addon_row_set_addon (GsAppAddonRow *row, GsApp *app)
        g_return_if_fail (GS_IS_APP_ADDON_ROW (row));
        g_return_if_fail (GS_IS_APP (app));
 
+       g_assert (row->app == NULL);
        row->app = g_object_ref (app);
 
        g_signal_connect_object (row->app, "notify::state",
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 8d51004..8e6666f 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -355,7 +355,10 @@ gs_app_row_set_app (GsAppRow *app_row, GsApp *app)
        GsAppRowPrivate *priv = gs_app_row_get_instance_private (app_row);
        g_return_if_fail (GS_IS_APP_ROW (app_row));
        g_return_if_fail (GS_IS_APP (app));
+
+       g_assert (priv->app == NULL);
        priv->app = g_object_ref (app);
+
        g_signal_connect_object (priv->app, "notify::state",
                                 G_CALLBACK (gs_app_row_notify_props_changed_cb),
                                 app_row, 0);


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