I suppose you use C++.
If the object is allocated dinamically, then you have to call delete to
call (implicitly) the destructor.
Or maybe you declared a new class (derived from the thread class you
istantiate an object of the new class using a pointer to the old class when
deleting it. That makes the base class distructor to be called, unless you
declare as virtual the destructor of the base class.
> Dear everyone,
> I have created a class for thread. Once this thread starts to run, it
> allocates some memory. In the destructor I deallocate this memory. When
> the program finishes then this destructor is not called.
> It is very strange, I thought that a destructor is always called.
> I am using solaris 2.7 and CC4.2 compiler.
> any suggestions.