[quote name='InvalidPointer' timestamp='1350362505' post='4990618']
[quote name='JohnnyCode' timestamp='1350101946' post='4989668']
yes, from C# object gets anownced that it would like to be freed (By OS manager GC). You then perform alll logic to free resources the object posesss. Like sicrane said, study cli/c++
in c++ destrocturos are not necesary, nor any good logic, from C#, managememet of memory yes
You can still design your logic to not need destructors, but your logic must be freed and managed well
I really, really hope you don't use C++ exceptions.
[/quote]
Why shouldn't one use exceptions in C++?
[/quote]
They can carry some very subtle, complicated costs and require some extra thinking when designing algorithms and classes. For games I don't really think they're worth said cost; in most cases using error codes can work equally well and can 're-enable' more dangerous (but speedier) class architectures. The latter is why I bring things up-- the C++ spec says the compiler will walk up the call stack, invoking destructors on everything until it finds an appropriate catch block. If you don't release any resources in the destructor, congratulations! You've just created a pretty massive, totally unfixable memory leak.
EDIT: [s]That also means that using raw allocations on the stack, anywhere, is unsafe. Consider the implications[/s]. Overloading operator new can help you in limited cases, come to think of it. If you don't, though, you're in trouble.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.