Skip to content

Instantly share code, notes, and snippets.

@tony2001
Created March 16, 2016 13:01
Show Gist options
  • Save tony2001/214a986c8b22339d101a to your computer and use it in GitHub Desktop.
Save tony2001/214a986c8b22339d101a to your computer and use it in GitHub Desktop.
diff --git a/php7/memcache_pool.c b/php7/memcache_pool.c
index 3aea80c..1ea9a98 100644
--- a/php7/memcache_pool.c
+++ b/php7/memcache_pool.c
@@ -771,6 +771,14 @@ static int mmc_server_connect(mmc_pool_t *pool, mmc_t *mmc, mmc_stream_t *io, in
mmc->error = NULL;
}
+ dtor_func_t origin_dtor;
+ origin_dtor = EG(regular_list).pDestructor;
+ EG(regular_list).pDestructor = NULL;
+ zend_hash_index_del(&EG(regular_list), io->stream->res->handle); /* ToDO: should it be res->handle, do streams register with addref ?*/
+ efree(io->stream->res);
+ io->stream->res = NULL;
+ EG(regular_list).pDestructor = origin_dtor;
+
return MMC_OK;
}
/* }}} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment