diff mbox series

[12/17] gweb: Add reference count debug statements.

Message ID 20231116010259.628527-13-gerickson@nuovations.com (mailing list archive)
State Superseded
Headers show
Series Address Redundant IPv4 Reachability Checks | expand

Commit Message

Grant Erickson Nov. 16, 2023, 1:02 a.m. UTC
This adds reference count debugging statements in 'g_web_ref' and
'g_web_unref', similar but not identical to other modules in the
project.
---
 gweb/gweb.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/gweb/gweb.c b/gweb/gweb.c
index 1cf830a46773..994c33638e55 100644
--- a/gweb/gweb.c
+++ b/gweb/gweb.c
@@ -414,6 +414,9 @@  GWeb *g_web_ref(GWeb *web)
 	if (!web)
 		return NULL;
 
+	debug(web, "ref %d",
+		web->ref_count + 1);
+
 	__sync_fetch_and_add(&web->ref_count, 1);
 
 	return web;
@@ -424,6 +427,9 @@  void g_web_unref(GWeb *web)
 	if (!web)
 		return;
 
+	debug(web, "ref %d",
+		web->ref_count - 1);
+
 	if (__sync_fetch_and_sub(&web->ref_count, 1) != 1)
 		return;