From d21c660ae2d3b2d5a0629e6770bca10578f6fb20 Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Wed, 25 Aug 2010 13:04:38 +0300 Subject: [PATCH] gisi: Fix counter for indication subscriptions --- gisi/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gisi/client.c b/gisi/client.c index 640484d..e3785a7 100644 --- a/gisi/client.c +++ b/gisi/client.c @@ -473,6 +473,7 @@ int g_isi_subscribe(GIsiClient *client, uint8_t type, { GIsiIndication *ind; GIsiIndication **old; + gboolean isnew = TRUE; if (cb == NULL) return -EINVAL; @@ -495,6 +496,7 @@ int g_isi_subscribe(GIsiClient *client, uint8_t type, if (*old != ind) { g_free(ind); ind = *old; + isnew = FALSE; } ind->func = cb; @@ -507,8 +509,11 @@ int g_isi_subscribe(GIsiClient *client, uint8_t type, g_free(ind); return ret; } - client->inds.count++; } + + if (isnew) + client->inds.count++; + return 0; } -- 2.7.4