- memcached_return rc;
- rc= memcached_do(ptr, server_key, "quit\r\n", 6, 1);
- WATCHPOINT_ASSERT(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_FETCH_NOTFINISHED);
+ if (io_death == 0)
+ {
+ memcached_return rc;
+ rc= memcached_do(ptr, server_key, "quit\r\n", 6, 1);
+ WATCHPOINT_ASSERT(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_FETCH_NOTFINISHED);
+
+ memcached_io_close(ptr, server_key);
+ }