listIter li;
struct dictEntry *de;
+ /* The key object might be destroyed when deleted from the c->io_keys
+ * list (and the "key" argument is physically the same object as the
+ * object inside the list), so we need to protect it. */
+ incrRefCount(key);
+
/* Remove the key from the list of keys this client is waiting for. */
listRewind(c->io_keys,&li);
while ((ln = listNext(&li)) != NULL) {
if (listLength(l) == 0)
dictDelete(c->db->io_keys,key);
+ decrRefCount(key);
return listLength(c->io_keys) == 0;
}