Bug 1086

Summary: sanity check for not calling Object::Dispose () twice
Product: ns-3 Reporter: Nicola Baldo <nicola>
Component: coreAssignee: Mathieu Lacage <mathieu.lacage>
Status: RESOLVED FIXED    
Severity: enhancement CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: sanity check on Object::Dispose()

Description Nicola Baldo 2011-03-30 11:39:07 EDT
Created attachment 1055 [details]
sanity check on Object::Dispose()

I wrote this patch to make sure that Object::Dispose () was not called twice on the same object in some code of mine. Is it of any real use?
Comment 1 Mathieu Lacage 2011-03-31 02:46:32 EDT
No, this is not needed:
1) it is already implemented. Did you not notice the m_disposed member variable ?
2) your implementation is not correct.

To summarize, you can already call Dispose many times on the same object or different objects aggregated together and DoDispose will be called only once for each aggregated object.
Comment 2 Nicola Baldo 2011-03-31 07:00:26 EDT
Fine, but then we(In reply to comment #1)
> No, this is not needed:
> 1) it is already implemented. Did you not notice the m_disposed member variable
> ?

I didn't notice because I was only looking at the doxygen documentation, which still said that it in as error to call Dispose twice. 

I just pushed changeset 6988:3f0d3324cbc5 to update the documentation according to your comment.