summaryrefslogtreecommitdiffstats
path: root/bindings/lang_php5_helpers/wrapper_source.py
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-05-09 17:12:40 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-05-09 17:12:40 +0000
commitffab8ef9136d92993bf0ec855c1eba55aa42e66b (patch)
tree644983b617e7f8623661e0055d4e3442e5680fab /bindings/lang_php5_helpers/wrapper_source.py
parent6a0a54e6e7d897b4981c054ef922fbab1b7fa47a (diff)
downloadlasso-ffab8ef9136d92993bf0ec855c1eba55aa42e66b.tar.gz
lasso-ffab8ef9136d92993bf0ec855c1eba55aa42e66b.tar.xz
lasso-ffab8ef9136d92993bf0ec855c1eba55aa42e66b.zip
* export dummy lasso_init/lasso_shutdown for compatibility
* module shutdown must return SUCCESS * verify if returned object is non-null before decrementing its refcount
Diffstat (limited to 'bindings/lang_php5_helpers/wrapper_source.py')
-rw-r--r--bindings/lang_php5_helpers/wrapper_source.py8
1 files changed, 6 insertions, 2 deletions
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'):