diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-02-09 13:01:58 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-02-09 13:01:58 (GMT) |
commit | 5863af232b8fc57de210702afe659a7383bb8840 (patch) | |
tree | 18e6fd0fb7be2f01d23cda34f8d7b3f29b1a250b /plugins/pychrysalide/access.c | |
parent | 32bef30025f5e3f513c2b4936c0573cc3b629961 (diff) |
Fixed another batch of memory leaks.
Diffstat (limited to 'plugins/pychrysalide/access.c')
-rw-r--r-- | plugins/pychrysalide/access.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/pychrysalide/access.c b/plugins/pychrysalide/access.c index bfaf160..4efa9c7 100644 --- a/plugins/pychrysalide/access.c +++ b/plugins/pychrysalide/access.c @@ -95,8 +95,6 @@ void register_access_to_python_module(const char *path, PyObject *mod) access.path = path; access.mod = mod; - Py_INCREF(mod); - _pychrysalide_modules = qinsert(_pychrysalide_modules, &_pychrysalide_count, sizeof(module_access), (__compar_fn_t)compare_python_module_accesses, &access); @@ -135,3 +133,23 @@ PyObject *get_access_to_python_module(const char *path) return result; } + + +/****************************************************************************** +* * +* Paramètres : - * +* * +* Description : Supprime tous les accès rapide aux modules Python. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void clear_all_accesses_to_python_modules(void) +{ + if (_pychrysalide_modules != NULL) + free(_pychrysalide_modules); + +} |