R
r.z.
I logged construtor and destructor calls for one of my classes and I
discovered that the constructor was called only once while the destructor
was called 3 times for a single object.
I have a vector of objects of class A:
vector<A> vector_of_As;
and I put objects to it like this:
vector_of_As.push_back( A() );
vector_of_As is local so it dies naturally, while As deallocate some memory
in their destructors. Can multiple calls to the destructor of A cause
program crash?
discovered that the constructor was called only once while the destructor
was called 3 times for a single object.
I have a vector of objects of class A:
vector<A> vector_of_As;
and I put objects to it like this:
vector_of_As.push_back( A() );
vector_of_As is local so it dies naturally, while As deallocate some memory
in their destructors. Can multiple calls to the destructor of A cause
program crash?