From d21c660ae2d3b2d5a0629e6770bca10578f6fb20 Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Wed, 25 Aug 2010 13:04:38 +0300 Subject: gisi: Fix counter for indication subscriptions --- gisi/client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gisi') diff --git a/gisi/client.c b/gisi/client.c index 640484d6..e3785a72 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; } -- cgit v1.2.3