Hi Frederico,

as this sound like a bug  I a created a ticket here:
http://bugs.mitk.org/show_bug.cgi?id=19329

I’ll have a closer look at this next Wednesday. In the meantime could you try 
if the problem also exists if you get the DataNode and and execute

dataNode->SetDataInteractor(NULL)

instead of

dataInteractor->SetDataNode(NULL) ?

My first guess would be that the notification about these changes are somehow 
missed and the mitk::Dispatcher still holds a reference to your DataNode.

(You can query with GetNumberOfInteractors() on the Dispatcher if this might be 
the case)


Cheers,
Christian


Von: Federico Milano [mailto:fmil...@gmail.com]
Gesendet: Mittwoch, 16. September 2015 18:34
An: mitk-users@lists.sourceforge.net
Betreff: [mitk-users] DataNode extra reference

Hi. In my View I'm creating a DataNode and adding it to the DataStorage; I'm 
also creating a DataInterator and using the SetDataNode method to bind the new 
DataNode and the DataInteractor. I'm not storing any reference nor smartpointer 
to that DataNode anywhere else.
I've noticed that the DataNode is never destroyed when I delete it from the 
DataStorage. I have implemented NodeRemoved on my view to check the reference 
counting. It arrives with 5 references to this method (a surface node without 
an interactor comes with 3 references at that time). So, I thought, there is a 
cycle between the DataInteractor and the Datanode. After getting the 
DataInteractor and setting its DataNode to NULL, the DataInteractor is 
destroyed and my DataNode count reduces to 4 references. I still have one more 
reference than a normal surface node.
I'm registering my own mapper to display my node (it holds a PointSet but I'm 
displaying it differently); I'm not storing any reference to the node in my 
Mapper.
I find that this is a problem really hard to debug; do you have any clue/hint 
of what could be going on?

Thanks,

Federico
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to