summaryrefslogtreecommitdiff
path: root/ext/mcve
diff options
context:
space:
mode:
authorBrad House <bradmssw@php.net>2003-08-20 19:45:07 +0000
committerBrad House <bradmssw@php.net>2003-08-20 19:45:07 +0000
commitf0bf9dd62d0b251f7901ee482c845a015797d634 (patch)
treee0f8600472f142913da747c9b177484e209dd626 /ext/mcve
parentd7e6bdaa0f5e274c07c38fca6ebfe791b3f19f3c (diff)
downloadphp-git-f0bf9dd62d0b251f7901ee482c845a015797d634.tar.gz
allow destructor to clean up connection data
Diffstat (limited to 'ext/mcve')
-rw-r--r--ext/mcve/mcve.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/mcve/mcve.c b/ext/mcve/mcve.c
index 964a895de2..a51a422c24 100644
--- a/ext/mcve/mcve.c
+++ b/ext/mcve/mcve.c
@@ -508,10 +508,17 @@ PHP_FUNCTION(mcve_destroyconn)
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE)
WRONG_PARAM_COUNT;
+/* If MCVE_DestroyConn() is called within a PHP script, the Resource handle is
+ never cleared, as there does not appear to be an UNREGISTER or DESTROY resource
+ call in the Zend API. What happens is this uninitialized memory location is
+ passed again to the MCVE_DestroyConn() function at script exit (cleanup), and
+ causes weird stuff. So we just go ahead and let the PHP garbage collector call
+ our _free_mcve_conn() we registered (le_conn) to clean up */
+#if 0
ZEND_FETCH_RESOURCE(conn, MCVE_CONN *, arg, -1, "mcve connection", le_conn);
MCVE_DestroyConn(conn);
-
+#endif
RETURN_TRUE;
}
/* }}} */