1 2 /* ------------------------------------------------------------ 3 * The start of the PHP initialization function 4 * ------------------------------------------------------------ */ 5 6 %insert(init) "swiginit.swg" 7 8 %init %{ 9 SWIG_php_minit { 10 SWIG_InitializeModule(0); 11 %} 12 13 %fragment("swig_php_init_member_ptr2", "header") { 14 #define SWIG_MEMBER_PTR ((char*)"CLASS::*") 15 16 static void swig_member_ptr_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { 17 efree(rsrc->ptr); 18 } 19 20 static int swig_member_ptr = 0; 21 } 22 23 %fragment("swig_php_init_member_ptr", "init", fragment="swig_php_init_member_ptr2") { 24 swig_member_ptr = zend_register_list_destructors_ex(swig_member_ptr_dtor, NULL, SWIG_MEMBER_PTR, module_number); 25 } 26