From 689b8cd722a0a3e08d91201b236ec1110d5bb745 Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Fri, 25 Sep 2009 13:51:09 +0000 Subject: [PATCH] In case of multiple addType with same type : does not throw Error anymore but cerr and return this way it is possible to execute python script more than one time Adding trace information for DirectDeleteMethod --- hurricane/src/isobar/PyHurricane.cpp | 7 +++++-- hurricane/src/isobar/hurricane/isobar/PyHurricane.h | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hurricane/src/isobar/PyHurricane.cpp b/hurricane/src/isobar/PyHurricane.cpp index 278f9748..ca2df8d9 100644 --- a/hurricane/src/isobar/PyHurricane.cpp +++ b/hurricane/src/isobar/PyHurricane.cpp @@ -206,8 +206,11 @@ using namespace Hurricane; , bool isPythonType , const char* idBase ) { for ( unsigned i=0 ; i < _types.size() ; i++ ) { - if ( ! strcmp ( _types[i]->_id, id ) ) - throw Error ( objectTypeRedefinition ); + if ( ! strcmp ( _types[i]->_id, id ) ) { + //throw Error ( objectTypeRedefinition ); // 04.09.2009 d2 modification + cerr << objectTypeRedefinition << endl; + return; + } } assert ( strlen ( id ) < 11 ); diff --git a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h index a581e13c..d854fa55 100644 --- a/hurricane/src/isobar/hurricane/isobar/PyHurricane.h +++ b/hurricane/src/isobar/hurricane/isobar/PyHurricane.h @@ -321,7 +321,11 @@ extern "C" { trace << #PY_SELF_TYPE"_DeAlloc(" << hex << self << ") " \ << self->ACCESS_OBJECT << endl; \ \ - if ( self->ACCESS_OBJECT ) delete self->ACCESS_OBJECT; \ + if ( self->ACCESS_OBJECT ) { \ + trace << "C++ object := " << hex \ + << &(self->ACCESS_OBJECT) << endl; \ + delete self->ACCESS_OBJECT; \ + } \ PyObject_DEL ( self ); \ }