diff options
| author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-10-01 10:31:58 +0000 |
|---|---|---|
| committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2008-10-01 10:31:58 +0000 |
| commit | ef42f2cbc8eb16df1a8e45650c652d227fd35ef4 (patch) | |
| tree | 35b69e41a882c19f11b61ecfe2f7d0d4ff718faf /bindings/python | |
| parent | 7290225b00d65a7ea111ddf3216bf7d9f39a81b6 (diff) | |
| download | lasso-ef42f2cbc8eb16df1a8e45650c652d227fd35ef4.tar.gz lasso-ef42f2cbc8eb16df1a8e45650c652d227fd35ef4.tar.xz lasso-ef42f2cbc8eb16df1a8e45650c652d227fd35ef4.zip | |
add functionality to enable debugging flags at runtime
This code permit to set flags, separated by commas, space,
tabulations, or colons. This flags activates debug functions like,
suppressing validations of signatures or print debugging message about
deallocations.
The new flags are defined in /lasso/debug.h they can be set using an
environment variable named LASSO_FLAG or a function named
lasso_set_flag.
There are two flags currently:
- verify-signature:
To deactivate it, pass 'no-verify-signature' inside LASSO_DEBUG.
It desactivate signature verification, inside two functions:
lasso_query_verify_signature and lasso_provider_verify_signature.
- memory-debug:
It enabled reporting of memory deallocation inside generic memory
dellaocator for LassoNode objects and also in bindings.
- lasso/xml/xml.c: do not free a null hash table pointer.
Diffstat (limited to 'bindings/python')
| -rw-r--r-- | bindings/python/wrapper_top.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c index 3a710ab7..b40c39f5 100644 --- a/bindings/python/wrapper_top.c +++ b/bindings/python/wrapper_top.c @@ -3,6 +3,7 @@ #include <lasso/lasso.h> #include <config.h> #include "../ghashtable.h" +#include "../../lasso/debug.h" GQuark lasso_wrapper_key; @@ -375,12 +376,12 @@ failure: static void PyGObjectPtr_dealloc(PyGObjectPtr *self) { -#ifdef LASSO_DEBUG - fprintf(stderr, "dealloc (%p ptr to %p (type:%s, rc:%d))\n", - self, self->obj, - G_OBJECT_TYPE_NAME(self->obj), - self->obj->ref_count); -#endif + if (lasso_flag_memory_debug) { + fprintf(stderr, "dealloc (%p ptr to %p (type:%s, rc:%d))\n", + self, self->obj, + G_OBJECT_TYPE_NAME(self->obj), + self->obj->ref_count); + } g_object_set_qdata_full(self->obj, lasso_wrapper_key, NULL, NULL); g_object_unref(self->obj); Py_XDECREF(self->typename); |
