summaryrefslogtreecommitdiff
path: root/ext/shmop/shmop.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/shmop/shmop.c')
-rw-r--r--ext/shmop/shmop.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index f2531acd18..bbaadb84c0 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -60,21 +60,20 @@ zend_module_entry shmop_module_entry = {
ZEND_GET_MODULE(shmop)
#endif
-static void rsclean(struct php_shmop *shmop);
+static void rsclean(zend_rsrc_list_entry *rsrc)
+{
+ struct php_shmop *shmop = (struct php_shmop *)rsrc->ptr;
+ shmdt(shmop->addr);
+ efree(shmop);
+}
PHP_MINIT_FUNCTION(shmop)
{
- shm_type = register_list_destructors(rsclean, NULL);
+ shm_type = register_list_destructors(rsclean, NULL, "shmop");
return SUCCESS;
}
-static void rsclean(struct php_shmop *shmop)
-{
- shmdt(shmop->addr);
- efree(shmop);
-}
-
PHP_MSHUTDOWN_FUNCTION(shmop)
{
return SUCCESS;