From 12ac23713eab846b9ee6ce25a74822229d0a59fa Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 3 Mar 2016 18:14:20 +0100 Subject: [PATCH] Duplicate ScalarSignal creation (signal & global) in VhdlEntity. * Bug: In CRL Core, in VhdlEntity, when a scalar signal is also global, two ScalarSignal where created, but only one can be linked as a property on a Net. So when the one *not* linked as a property was deleted, an infinite loop started (under Cygwin at least). The _globals list now contains pointers to signals that are in _signals. The _globals elements no longer needs to be deleted. --- crlcore/src/ccore/alliance/vst/VhdlEntity.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crlcore/src/ccore/alliance/vst/VhdlEntity.cpp b/crlcore/src/ccore/alliance/vst/VhdlEntity.cpp index e79376cb..87d2f2eb 100644 --- a/crlcore/src/ccore/alliance/vst/VhdlEntity.cpp +++ b/crlcore/src/ccore/alliance/vst/VhdlEntity.cpp @@ -132,9 +132,10 @@ namespace Vhdl { signal->addNet( index, net ); _signals.insert( signal ); } else { - _signals.insert( new ScalarSignal(net) ); + ScalarSignal* signal = new ScalarSignal(net); + _signals.insert( signal ); if (net->isGlobal()) - _globals.insert( new ScalarSignal(net) ); + _globals.insert( signal ); } } @@ -145,7 +146,7 @@ namespace Vhdl { Entity::~Entity () { for ( auto signal : _signals ) delete signal; - for ( auto global : _globals ) delete global; + //for ( auto global : _globals ) delete global; for ( auto ientity=_entities.begin() ; ientity!=_entities.end() ; ++ientity ) { if (*ientity == this) { _entities.erase( ientity );