Considering the following situation:
-You have written a method for your class. In that method you called another function, then do something another about your class's member, like reading or modifying the value of some property members.
-The function that your method calling is a client-defined one, which means that the content of the function is not controlled by you, as callback-function or a virtual-function in the inheritanced-class or functor-object.
-For some reasons you can't use shared-ptr managers in your class, an example is that some objects required by your method is handled only when your class object is valid fully.
-A coder has written his callbacker to delete your class object.
In upper case, your class can't even read the content of itself because it has been removed from the memory after the callbacker returned.
Add the classes this document related into your class' code, the nsObjDeleteMon::CGuard member will store the state of the existing info about your class object to the CInfoStackStation objects, which are the local-variables defined in the function and keep legal-access status even after your class object being destroyed.

Last edited Aug 7, 2011 at 12:03 PM by UnitUniverse, version 3


No comments yet.