From 8950dfd59f83e6df465786c5a841a8a7cef78f4a Mon Sep 17 00:00:00 2001 From: "jino.cho" Date: Thu, 27 Apr 2017 10:54:04 +0900 Subject: [PATCH] Decrease the reference count of the dbus proxy The resource will be destroyed when its reference count drops to zero. Change-Id: Ibaca7da33eb6538b9c1928c5b8ea2b06eaf03245 Signed-off-by: jino.cho --- src/peripheral_dbus.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/peripheral_dbus.c b/src/peripheral_dbus.c index 9cf8af5..e685b71 100644 --- a/src/peripheral_dbus.c +++ b/src/peripheral_dbus.c @@ -78,17 +78,26 @@ void pwm_proxy_init(void) void gpio_proxy_deinit() { - gpio_proxy = NULL; + if (gpio_proxy) { + g_object_unref(gpio_proxy); + gpio_proxy = NULL; + } } void i2c_proxy_deinit() { - i2c_proxy = NULL; + if (i2c_proxy) { + g_object_unref(i2c_proxy); + i2c_proxy = NULL; + } } void pwm_proxy_deinit() { - pwm_proxy = NULL; + if (pwm_proxy) { + g_object_unref(pwm_proxy); + pwm_proxy = NULL; + } } int peripheral_dbus_gpio_open(peripheral_gpio_h gpio) -- 2.7.4