diff options
Diffstat (limited to 'gisi')
-rw-r--r-- | gisi/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |