From ffab8ef9136d92993bf0ec855c1eba55aa42e66b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 9 May 2008 17:12:40 +0000 Subject: * export dummy lasso_init/lasso_shutdown for compatibility * module shutdown must return SUCCESS * verify if returned object is non-null before decrementing its refcount --- bindings/lang_php5_helpers/wrapper_source.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bindings/lang_php5_helpers/wrapper_source.py') diff --git a/bindings/lang_php5_helpers/wrapper_source.py b/bindings/lang_php5_helpers/wrapper_source.py index a882d2fa..dfeb47fe 100644 --- a/bindings/lang_php5_helpers/wrapper_source.py +++ b/bindings/lang_php5_helpers/wrapper_source.py @@ -49,6 +49,8 @@ class WrapperSource: def generate_header(self): self.functions_list.append('lasso_get_object_typename') + self.functions_list.append('lasso_init') + self.functions_list.append('lasso_shutdown') print >> self.fd, '''\ /* this file has been generated automatically; do not edit */ @@ -94,6 +96,7 @@ PHP_MINIT_FUNCTION(lasso) PHP_MSHUTDOWN_FUNCTION(lasso) { lasso_shutdown(); + return SUCCESS; } ''' @@ -165,8 +168,9 @@ PHP_MSHUTDOWN_FUNCTION(lasso) RETVAL_NULL(); }''' if free: -# print >> self.fd, ' printf("UNREF %p line %i\\n", return_c_value, __LINE__);' - print >> self.fd, ' g_object_unref(return_c_value); // Constructor' + print >> self.fd, ' if (return_c_value) {' + print >> self.fd, ' g_object_unref(return_c_value); // If constructor ref is off by one' + print >> self.fd, ' }' def generate_function(self, m): if m.name in ('lasso_init','lasso_shutdown'): -- cgit