In these situations of parent to child relationships, the child object commonly has a Close method. This Close method should clean up all allocation paths to the object except that of the parent. During development testing I'd like to have enabled some tracing function called by each Close method that would trace a warning if it detected any root paths that did not go through the parent.
Is it feasible to write such a function using the MemProfiler API? And do you have any guidance or samples for where I could start?
I'd expect there to be a performance cost when the tracing is enabled and a small percentage of false positives would be acceptable.
Any help is appreciated.
We are also working on improving the memory assertions for the next version and I believe that the new assertions functionality might be useful in your case.
In the meantime I think that you will have to analyse the snapshot manually, but you can of course trigger the snapshot collection from the Close method.
SciTech Software AB
Users browsing this forum: No registered users and 9 guests