wasmerio / wasmer-php

🐘🕸️ WebAssembly runtime for PHP
https://wasmerio.github.io/wasmer-php/wasm/
MIT License
1k stars 42 forks source link

fix(extension) Register a persistent resource destructor. #34

Closed Hywan closed 5 years ago

Hywan commented 5 years ago

Sequel of #33.

The zend_register_list_destructors_ex API expects one function pointer for the resource destructor, and another function pointer for the persistent resource destructor. I missed that details, and it explains why the destructor was never called for a persistent resource. Now it works! No more memory leaks.

cc @nikic in case you want to know the end of the story :-).