From: jino.cho Date: Thu, 27 Apr 2017 01:54:04 +0000 (+0900) Subject: Decrease the reference count of the dbus proxy X-Git-Tag: submit/tizen/20170508.033648~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8950dfd59f83e6df465786c5a841a8a7cef78f4a;p=platform%2Fcore%2Fapi%2Fperipheral-io.git 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 --- 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)