I normally use csRef for anything I grab from CS like iGraphics2D. It is the safest way to prevent memory leaks. The easiest way to check stuff like that is to call
object->GetRefCount() to see how many things are accessing it.
If at the end you keep getting stuff like "Unreleased references" you can use the GetRefCount() to track them down ( painful sometimes ).
The example you show with iSector is ok since it is just a plain pointer so unless you do an IncRef on it you don't need a DecRef.
Edit: Update with correct info :)
---------
Andrew
[Edited by - acraig on July 8, 2004 9:06:28 AM]
Segmentation fault in simple crystal space program
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement