library: remove request in hash table on timeout 18/45718/1 accepted/tizen/mobile/20150811.014122 accepted/tizen/tv/20150811.014134 accepted/tizen/wearable/20150811.014154 submit/tizen/20150810.141928
authorSuchang Woo <suchang.woo@samsung.com>
Mon, 10 Aug 2015 13:24:04 +0000 (22:24 +0900)
committerSuchang Woo <suchang.woo@samsung.com>
Mon, 10 Aug 2015 13:24:04 +0000 (22:24 +0900)
Change-Id: I91732c69bc7dec2d26c7fc488a2642e073ad3763
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
lib/buxton2.c

index 0f046fa..37f1ad8 100644 (file)
@@ -720,8 +720,11 @@ static int wait_msg(struct buxton_client *client, guint32 msgid)
                }
 
                /* poll or proc error */
-               if (r == -1)
+               if (r == -1) {
+                       g_hash_table_remove(client->req_cbs,
+                                       GUINT_TO_POINTER(msgid));
                        return -1;
+               }
 
                req = g_hash_table_lookup(client->req_cbs,
                                GUINT_TO_POINTER(msgid));
@@ -736,6 +739,8 @@ static int wait_msg(struct buxton_client *client, guint32 msgid)
        bxt_err("wait response: timeout");
        errno = ETIMEDOUT;
 
+       g_hash_table_remove(client->req_cbs, GUINT_TO_POINTER(msgid));
+
        return -1;
 }