Fix various issues:
+ fix dangling pointers when fetching Python error text + initialize members in overloaded constructors of Exception class + implement assignment operator in sub-class + move to PyCXX API to simplify handling with reference counting and reading values from the dict
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "ExceptionFactory.h"
|
||||
#include <CXX/Objects.hxx>
|
||||
|
||||
using namespace Base;
|
||||
|
||||
@@ -46,12 +47,9 @@ void ExceptionFactory::raiseException (PyObject * pydict) const
|
||||
{
|
||||
std::string classname;
|
||||
|
||||
PyObject *pystring;
|
||||
|
||||
pystring = PyDict_GetItemString(pydict,"sclassname");
|
||||
|
||||
if(pystring!=NULL) {
|
||||
classname = std::string(PyString_AsString(pystring));
|
||||
Py::Dict edict(pydict);
|
||||
if (edict.hasKey("sclassname")) {
|
||||
classname = static_cast<std::string>(Py::String(edict.getItem("sclassname")));
|
||||
|
||||
std::map<const std::string, AbstractProducer*>::const_iterator pProd;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user