Additional fix to handle reference count of proxy 19/131019/2
authorSungguk Na <sungguk.na@samsung.com>
Thu, 25 May 2017 05:14:22 +0000 (14:14 +0900)
committerHyeongsik Min <hyeongsik.min@samsung.com>
Thu, 25 May 2017 06:55:28 +0000 (06:55 +0000)
Proxy object should be NULL after proxy deinit,
but g_object_unref just make free the object and do not make it NULL

Change-Id: I5ca2c14606527f5610181d6470d099fcf681c8cd
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
src/peripheral_gdbus_gpio.c
src/peripheral_gdbus_i2c.c
src/peripheral_gdbus_pwm.c
src/peripheral_gdbus_uart.c

index 1c0e90f906601e2abb0cc5cd4cf29c640e3e3aaf..0bbe4f738276e23151e99c154acb5141458c9c41 100644 (file)
@@ -60,6 +60,8 @@ void gpio_proxy_deinit()
 {
        if (gpio_proxy) {
                g_object_unref(gpio_proxy);
+               if (!G_IS_OBJECT(gpio_proxy))
+                       gpio_proxy = NULL;
        }
 }
 
index 2e176efc81597286bd68f5b5deb55a74d4ab31f6..c30399b8c08e039899998ba23b6f540b18cb7be7 100644 (file)
@@ -47,6 +47,8 @@ void i2c_proxy_deinit()
 {
        if (i2c_proxy) {
                g_object_unref(i2c_proxy);
+               if (!G_IS_OBJECT(i2c_proxy))
+                       i2c_proxy = NULL;
        }
 }
 
index 31b2a78389f4f583ca835afd12a329d88aaaa1fd..a3b8b5106ca26f883d2258e520e037b0d6d23c41 100644 (file)
@@ -47,6 +47,8 @@ void pwm_proxy_deinit()
 {
        if (pwm_proxy) {
                g_object_unref(pwm_proxy);
+               if (!G_IS_OBJECT(pwm_proxy))
+                       pwm_proxy = NULL;
        }
 }
 
index cf51b227288457ba29c8cb5b700ae28d1e5dab88..0a80e727d275d346102bc54228e0bb8a4a7e3335 100644 (file)
@@ -47,6 +47,8 @@ void uart_proxy_deinit()
 {
        if (uart_proxy) {
                g_object_unref(uart_proxy);
+               if (!G_IS_OBJECT(uart_proxy))
+                       uart_proxy = NULL;
        }
 }