aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Greer <mgreer@animalcreek.com>2017-03-08 21:34:10 +0000
committerSamuel Ortiz <sameo@linux.intel.com>2017-11-10 00:23:57 +0100
commit1321d5518d56674d873d075f368fdcddd2de0467 (patch)
treed2e3b2913afa2f5743581ac4f9bc24e842537213
parentb0ec85c5a57bf8f02c7d91fc90459f4faec7e917 (diff)
downloadneard-1321d5518d56674d873d075f368fdcddd2de0467.tar.gz
adapter: Clear timeout handle when check presence timer stopped
__near_adapter_stop_check_presence() stops the neard check presence timer but doesn't clear the timer handle. This can cause neard to try to stop the timer when it isn't running. To fix that, clear the handle so neard doesn't try to stop an already stopped timer. Signed-off-by: Mark Greer <mgreer@animalcreek.com>
-rw-r--r--src/adapter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 466753b..7be87e2 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -505,8 +505,10 @@ void __near_adapter_stop_check_presence(uint32_t adapter_idx,
if (!adapter)
return;
- if (adapter->presence_timeout > 0)
+ if (adapter->presence_timeout > 0) {
g_source_remove(adapter->presence_timeout);
+ adapter->presence_timeout = 0;
+ }
}
static const GDBusMethodTable adapter_methods[] = {