[Insight-users] Debug bug

Henkjan Huisman h . huisman at rad . umcn . nl
13 May 2003 11:47:25 +0200


Hi,

To prevent mesh objects from updating I was playing around with
DisconnectPipeline(). This works fine, but if the mesh under
consideration had its Debug set 'on', then a segmentation fault occurs
when getting an update. The update wants to propagate the update to the
source, which is set to '0' in the disconnect. When debug is 'on', it
gets into DataObject::GetSource where the debug macro wants to print the
source. Which of course is not possible because it is '0'.

Seems like a bug to me, I suggest the following change:

DataObject
::GetSource() const
{
  if (m_Source) {
    itkDebugMacro("returning Source address " << m_Source );
    return m_Source.GetPointer();
  } else {
    return 0;
  }  
}

OK?


-- 
Henkjan

 ------------------------------------------------------------- 
|H.J. Huisman, PhD, MSEE       E : h.huisman@rad.umcn.nl      |
|Biomedical Physicist          T : +31 24 3617536/14545       |
|Dept. Radiology               F : +31 24 3540866             |
|UMC St. Radboud               S : 430 Radiologie/POBox 9101/ | 
|                                  6500HB Nijmegen/Netherlands|
 -------------------------------------------------------------