mirror of
https://github.com/php-win-ext/php-lua.git
synced 2026-03-24 00:52:12 +01:00
Merge pull request #31 from sgolemon/callback.refcount
Explicitly release held references to PHP callbacks
This commit is contained in:
15
lua.c
15
lua.c
@@ -63,6 +63,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_lua_free, 0, 0, 1)
|
||||
ZEND_END_ARG_INFO()
|
||||
/* }}} */
|
||||
|
||||
static PHP_RSHUTDOWN_FUNCTION(lua) /* {{{ */
|
||||
{
|
||||
zval *callbacks = zend_read_static_property(lua_ce, ZEND_STRL("_callbacks"), 1);
|
||||
|
||||
if (callbacks) {
|
||||
zval_ptr_dtor(callbacks);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ lua_module_entry
|
||||
*/
|
||||
zend_module_entry lua_module_entry = {
|
||||
@@ -74,7 +87,7 @@ zend_module_entry lua_module_entry = {
|
||||
PHP_MINIT(lua),
|
||||
PHP_MSHUTDOWN(lua),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_RSHUTDOWN(lua),
|
||||
PHP_MINFO(lua),
|
||||
#if ZEND_MODULE_API_NO >= 20010901
|
||||
PHP_LUA_VERSION,
|
||||
|
||||
Reference in New Issue
Block a user