Bugzilla – Bug 1086
sanity check for not calling Object::Dispose () twice
Last modified: 2011-03-31 07:00:26 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?
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.
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.