From fe058dfb3270492b9dd6887db15b03ce4eb4b145 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 10:29:44 +0200 Subject: [PATCH 1/2] Don't store two references to X11 Cursor, or we double free at shutdown --- panda/src/x11display/x11GraphicsWindow.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index 5195b8ac5d..5e4e7ee88c 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/panda/src/x11display/x11GraphicsWindow.cxx @@ -2146,7 +2146,6 @@ get_cursor(const Filename &filename) { } fi = _cursor_filenames.find(resolved); if (fi != _cursor_filenames.end()) { - _cursor_filenames[filename] = (*fi).second; return fi->second; } From 69b8d6a4b505d4ac5d55983a35415f3e6856396c Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 6 Jul 2015 10:31:33 +0200 Subject: [PATCH 2/2] Fix memory leak in tuple-returning getters --- dtool/src/interrogate/interfaceMakerPythonNative.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 30bb59d8a5..ec7e84adfe 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -6113,7 +6113,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName, << " return NULL;\n" << " }\n" << "\n" - << " PyObject *getter = PyObject_GetAttrString(self, \"" << element_name << "\");\n" + << " PyObject *getter = PyDict_GetItemString(Dtool_" << ClassName << "._PyType.tp_dict, \"" << element_name << "\");\n" << " if (getter == (PyObject *)NULL) {\n" << " return NULL;\n" << " }\n" @@ -6127,7 +6127,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName, << "#else\n" << " PyObject *index = PyInt_FromSsize_t(i);\n" << "#endif\n" - << " PyObject *value = PyObject_CallFunctionObjArgs(getter, index, NULL);\n" + << " PyObject *value = PyObject_CallFunctionObjArgs(getter, self, index, NULL);\n" << " PyTuple_SET_ITEM(tuple, i, value);\n" << " Py_DECREF(index);\n" << " }\n"