From 384b9071a2c1585bc7b02952defc6f56b80e8800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Fri, 10 Nov 2023 10:43:24 +0100 Subject: [PATCH] Set parameters working --- src/PyClassifier.cc | 2 +- src/PyWrap.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PyClassifier.cc b/src/PyClassifier.cc index f75387e..19dc5d6 100644 --- a/src/PyClassifier.cc +++ b/src/PyClassifier.cc @@ -5,7 +5,7 @@ namespace pywrap { namespace np = boost::python::numpy; PyClassifier::PyClassifier(const std::string& module, const std::string& className) : module(module), className(className), fitted(false) { - id = reinterpret_cast(&this); + id = 0;//reinterpret_cast(&this); pyWrap = PyWrap::GetInstance(); pyWrap->importClass(module, className); } diff --git a/src/PyWrap.cc b/src/PyWrap.cc index 24d7b6c..c6f8ce9 100644 --- a/src/PyWrap.cc +++ b/src/PyWrap.cc @@ -133,7 +133,7 @@ namespace pywrap { } int res = PyObject_SetAttrString(instance, key.c_str(), pValue); if (res == -1 && PyErr_Occurred()) { - cleanDictionary(args); + Py_XDECREF(pValue); errorAbort("Couldn't set attribute " + key + "=" + value.dump()); } Py_XDECREF(pValue);