summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlokilee73 <changjoo.lee@samsung.com>2021-02-17 14:47:48 +0900
committerlokilee73 <changjoo.lee@samsung.com>2021-02-17 14:48:49 +0900
commitccac3a7bfe32f17c00b7342529b23063e36775ad (patch)
tree3d21465b8c0c330d4852f98d248a6b8dc83b2d34
parent412e5d315325d0b3247df31bf24e1e495226c5dc (diff)
downloaddevice-emulator-ccac3a7bfe32f17c00b7342529b23063e36775ad.tar.gz
device-emulator-ccac3a7bfe32f17c00b7342529b23063e36775ad.tar.bz2
device-emulator-ccac3a7bfe32f17c00b7342529b23063e36775ad.zip
Move unsubscribe_dbus_signal position to reset signal_id
Change-Id: I4a24e443ff5f1c07d8ccf178f212bbc1efcb0d42 Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
-rw-r--r--hw/battery/battery.c5
-rw-r--r--hw/external_connection/external_connection.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/hw/battery/battery.c b/hw/battery/battery.c
index d3b3ca6..ce4d76a 100644
--- a/hw/battery/battery.c
+++ b/hw/battery/battery.c
@@ -150,9 +150,10 @@ static int battery_register_changed_event(
static void battery_unregister_changed_event(
BatteryUpdated updated_cb)
{
- unsubscribe_dbus_signal(NULL, signal_id);
- if (signal_id > 0)
+ if (signal_id > 0) {
+ unsubscribe_dbus_signal(NULL, signal_id);
signal_id = 0;
+ }
sdata.updated_cb = NULL;
sdata.data = NULL;
}
diff --git a/hw/external_connection/external_connection.c b/hw/external_connection/external_connection.c
index aca4ac2..5cd129b 100644
--- a/hw/external_connection/external_connection.c
+++ b/hw/external_connection/external_connection.c
@@ -138,9 +138,10 @@ static int external_connection_register_changed_event(
static void external_connection_unregister_changed_event(
ConnectionUpdated updated_cb)
{
- unsubscribe_dbus_signal(NULL, signal_id);
- if (signal_id > 0)
+ if (signal_id > 0) {
+ unsubscribe_dbus_signal(NULL, signal_id);
signal_id = 0;
+ }
sdata.updated_cb = NULL;
sdata.data = NULL;
}