]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkConnection.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkConnection.cxx
index 8d60b38699afa0f73b65fa34d6243c95155a5d09..2c99b6e2518a8a274b59357c1bfa45eadc2f6c54 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkConnection.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/18 12:51:26 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/08 06:59:30 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See doc/license.txt or
@@ -122,7 +122,13 @@ namespace bbtk
 
   //==================================================================
   
-  
+  void Connection::Clear()
+  {
+    mFrom = 0;
+    mTo = 0;
+    mAdaptor = 0;
+  }
+
   //==================================================================
   /// Dtor 
   Connection::~Connection()
@@ -131,8 +137,8 @@ namespace bbtk
                        "Connection::~Connection() ["
                        <<GetFullName()<<"]"<<std::endl);
 
-    mFrom->bbDisconnectOutput(mOutput,this);
-    mTo->bbDisconnectInput(mInput,this);
+    if (mFrom) mFrom->bbDisconnectOutput(mOutput,this);
+    if (mTo) mTo->bbDisconnectInput(mInput,this);
     if (mAdaptor) mAdaptor->bbDelete();
 
     bbtkDebugDecTab("Kernel",7);