Unwatch gdbus when object destroyed 13/199413/2
authorhyunho <hhstark.kang@samsung.com>
Mon, 11 Feb 2019 07:50:59 +0000 (16:50 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 11 Feb 2019 07:51:59 +0000 (07:51 +0000)
gdbus should be unwatched when it's owner is destoryed

Change-Id: Id7e6778462097a4c76aa176a09fa97b4725c8ab4
Signed-off-by: hyunho <hhstark.kang@samsung.com>
watchface-complication/complication.cc

index d657c65..9bdebe0 100644 (file)
@@ -155,6 +155,8 @@ Complication::Impl::~Impl() {
   LOGI("complication destroy %d", complication_id_);
   if (periodic_timer_)
     g_source_remove(periodic_timer_);
+  if (watcher_id_ > 0)
+    gdbus_.get()->UnWatch(watcher_id_);
   package_.get()->UnWatch(this);
   for (auto& i : complication_id_list_) {
     if (i == complication_id_) {