diff mbox series

[v2,04/17] service: Document service unref calls in 'cancel_online_check'.

Message ID 20231119170714.775270-5-gerickson@nuovations.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Address Redundant IPv4 Reachability Checks | expand

Commit Message

Grant Erickson Nov. 19, 2023, 5:07 p.m. UTC
This adds a comment to the two calls to 'connman_service_unref' in
'cancel_online_check' to help aid present and future readers in
identifying where the balacing reference retain occurs.
---
 src/service.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/src/service.c b/src/service.c
index 075f3fba5abe..5fb53c2084f9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1590,11 +1590,23 @@  static void cancel_online_check(struct connman_service *service)
 	if (service->online_timeout_ipv4) {
 		g_source_remove(service->online_timeout_ipv4);
 		service->online_timeout_ipv4 = 0;
+
+		/*
+		 * This balances the retained referece made when
+		 * g_timeout_add_seconds was called to schedule this
+		 * now-cancelled scheduled online check.
+		 */
 		connman_service_unref(service);
 	}
 	if (service->online_timeout_ipv6) {
 		g_source_remove(service->online_timeout_ipv6);
 		service->online_timeout_ipv6 = 0;
+
+		/*
+		 * This balances the retained referece made when
+		 * g_timeout_add_seconds was called to schedule this
+		 * now-cancelled scheduled online check.
+		 */
 		connman_service_unref(service);
 	}
 }