[gnome-software] trivial: Guard against self-setting origin



commit e83e558f524bb5761dc17abc629ecbdef49c458b
Author: William Hua <william hua canonical com>
Date:   Thu Apr 14 01:17:04 2016 -0400

    trivial: Guard against self-setting origin

 src/gs-app.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index beaaaca..747fe05 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1564,6 +1564,8 @@ void
 gs_app_set_origin (GsApp *app, const gchar *origin)
 {
        g_return_if_fail (GS_IS_APP (app));
+       if (origin == app->origin)
+               return;
        g_free (app->origin);
        app->origin = g_strdup (origin);
 }
@@ -1595,6 +1597,8 @@ void
 gs_app_set_origin_ui (GsApp *app, const gchar *origin_ui)
 {
        g_return_if_fail (GS_IS_APP (app));
+       if (origin_ui == app->origin_ui)
+               return;
        g_free (app->origin_ui);
        app->origin_ui = g_strdup (origin_ui);
 }


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