summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-05-15 11:41:28 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-05-15 11:46:00 +0300
commitde663bfc39d13515eb549e70d59329eb83892aa0 (patch)
tree9f04ca8e2d34b2e02df2f3d400365729aeed8370 /plugins
parent422015388dbe35d4543380f0a1a80b83f2e5429c (diff)
downloadbluez-de663bfc39d13515eb549e70d59329eb83892aa0.tar.gz
plugins/policy: Remove reconnect timer in reconnect_reset()
In the case that the remote starts connecting to us while we're waiting for the timeout to discover we shouldn't just reset the basic time keeping variables but also remove the timer.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/policy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/policy.c b/plugins/policy.c
index b72467e7d..9a275daf8 100644
--- a/plugins/policy.c
+++ b/plugins/policy.c
@@ -429,6 +429,11 @@ static void reconnect_reset(struct reconnect_data *reconnect)
{
reconnect->start = 0;
reconnect->timeout = 1;
+
+ if (reconnect->timer > 0) {
+ g_source_remove(reconnect->timer);
+ reconnect->timer = 0;
+ }
}
static bool reconnect_match(const char *uuid)