[gnome-builder] flatpak: compare strings before changing property



commit 01cf5ec7d1dde97989e86d33849618f27a112e70
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 20 13:30:13 2017 -0700

    flatpak: compare strings before changing property

 plugins/flatpak/gbp-flatpak-runtime.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-runtime.c b/plugins/flatpak/gbp-flatpak-runtime.c
index f5a65bb..8c82d45 100644
--- a/plugins/flatpak/gbp-flatpak-runtime.c
+++ b/plugins/flatpak/gbp-flatpak-runtime.c
@@ -518,9 +518,12 @@ gbp_flatpak_runtime_set_sdk (GbpFlatpakRuntime *self,
 {
   g_return_if_fail (GBP_IS_FLATPAK_RUNTIME (self));
 
-  g_free (self->sdk);
-  self->sdk = g_strdup (sdk);
-  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SDK]);
+  if (g_strcmp0 (sdk, self->sdk) != 0)
+    {
+      g_free (self->sdk);
+      self->sdk = g_strdup (sdk);
+      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SDK]);
+    }
 }
 
 static void


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