X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBoxOutputConnector.cxx;h=af6bf5f21ed88febf007ea7e523d198dcf525aa7;hb=4ad5b5ee44357ad873bc8c43230defb6d0a79879;hp=d2ee80e74dec872efd777472318e9f46e7dcf3ae;hpb=c2a4b1893412e50a3d9abff221938a2d16c4a7cb;p=bbtk.git diff --git a/kernel/src/bbtkBlackBoxOutputConnector.cxx b/kernel/src/bbtkBlackBoxOutputConnector.cxx index d2ee80e..af6bf5f 100644 --- a/kernel/src/bbtkBlackBoxOutputConnector.cxx +++ b/kernel/src/bbtkBlackBoxOutputConnector.cxx @@ -3,8 +3,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBoxOutputConnector.cxx,v $ Language: C++ - Date: $Date: 2008/04/09 11:16:57 $ - Version: $Revision: 1.3 $ + Date: $Date: 2008/04/18 12:59:15 $ + Version: $Revision: 1.4 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -37,19 +37,21 @@ namespace bbtk BlackBoxOutputConnector::~BlackBoxOutputConnector() { - bbtkDebugMessageInc("Kernel",9, - "BlackBoxOutputConnector::~BlackBoxOutputConnector()" - <::iterator i; - for (i=mConnection.begin();i!=mConnection.end();++i) - { - delete *i; - } - bbtkDebugDecTab("Kernel",9); + bbtkDebugMessage("Kernel",9, + "==> BlackBoxOutputConnector::~BlackBoxOutputConnector()" + <Check(); - std::vector::iterator i - = find(mConnection.begin(),mConnection.end(),c); + if (!c) + { + bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<Check(); + //Connection::WeakPointer w(c); + ConnectionVector::iterator i; + // = find(mConnection.begin(),mConnection.end(),c); + for (i=mConnection.begin(); + i!=mConnection.end(); + ++i) + { + if (i->lock()==c) break; + } if (i==mConnection.end()) { bbtkInternalError("BlackBoxOutputConnector::UnsetConnection("<::iterator i; + ConnectionVector::iterator i; for (i=mConnection.begin();i!=mConnection.end();++i) { - (*i)->SetModifiedStatus(); + (*i).lock()->SetModifiedStatus(); } bbtkDebugDecTab("Process",5);