C++ has deterministic finalization. When you declare a stack-based object, at the end of the scope, the destructor is called before other work is done.

I just finished writing a response on this topic for a customer, and thought I'd share my favorite reference on the subject with you:

http://discuss.develop.com/archives/wa.exe?A2=ind0010A&L=DOTNET&P=R28572