Decrease the reference count of the dbus proxy 68/127268/2
authorjino.cho <jino.cho@samsung.com>
Thu, 27 Apr 2017 01:54:04 +0000 (10:54 +0900)
committerjino.cho <jino.cho@samsung.com>
Thu, 27 Apr 2017 01:56:14 +0000 (10:56 +0900)
The resource will be destroyed when its reference count drops to
zero.

Change-Id: Ibaca7da33eb6538b9c1928c5b8ea2b06eaf03245
Signed-off-by: jino.cho <jino.cho@samsung.com>
src/peripheral_dbus.c

index 9cf8af512cf7e85ff9c4ff88ae401f8d49484552..e685b71cdf3ceabea51dfea0a5469b9172ff7321 100644 (file)
@@ -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)