C
cronusf
I have code like this (pseudocode):
MyClass::MyClass()
{
Array1 = new D3DXVECTOR3[MaxVertexCount];
Array2 = new USHORT[MaxIndexCount];
fx = gcnew Effect();
}
Suppose the constructor for Effect throws an exception. During the
stack unwinding, will Array1 and Array2 be deleted?
I put the delete[] code in the destructor and finalizer, but I noticed
(through trace statements) the destructor and finalizer is never
called. Do I need a try/finally here to make sure the memory is
deleted?
MyClass::MyClass()
{
Array1 = new D3DXVECTOR3[MaxVertexCount];
Array2 = new USHORT[MaxIndexCount];
fx = gcnew Effect();
}
Suppose the constructor for Effect throws an exception. During the
stack unwinding, will Array1 and Array2 be deleted?
I put the delete[] code in the destructor and finalizer, but I noticed
(through trace statements) the destructor and finalizer is never
called. Do I need a try/finally here to make sure the memory is
deleted?