telepathy-mission-control: McpAccountStorage: don' t double-register signals if implemented twice

Simon McVittie smcv at kemper.freedesktop.org
Thu Oct 4 08:19:48 PDT 2012


Module: telepathy-mission-control
Branch: master
Commit: 76c62bcf500acc21ef8db2064ed00d01e51b039d
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=76c62bcf500acc21ef8db2064ed00d01e51b039d

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Sep 10 10:31:43 2012 +0100

McpAccountStorage: don't double-register signals if implemented twice

The base_init function of a GInterface is called once per implementor.

Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>

---

 mission-control-plugins/account-storage.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/mission-control-plugins/account-storage.c b/mission-control-plugins/account-storage.c
index 1e1414a..beecf75 100644
--- a/mission-control-plugins/account-storage.c
+++ b/mission-control-plugins/account-storage.c
@@ -116,6 +116,12 @@ class_init (gpointer klass,
 {
   GType type = G_TYPE_FROM_CLASS (klass);
 
+  if (signals[CREATED] != 0)
+    {
+      DEBUG ("already registered signals");
+      return;
+    }
+
   /**
    * McpAccountStorage::created
    * @account: the unique name of the created account



More information about the telepathy-commits mailing list