Closed lisachenko closed 4 years ago
Surprisingly, this patch is not so easy, as previous one. There are a lot of hell with releasing zend_class_name
structure, because it contains two zend_string
pointers and zend_string_release
function is not exported, thus need to copy-paste all the logic to control the behavior of allocated strings to prevent memory leaks and segfaults.
This issue pretty same as #9, but relates to the traits. Receipt as previous: for internal classes we should use persistent memory, for user-defined non-persistent memory should be used.
Also, for user-defined classes previously allocated memory should be freed to prevent leaks.