The strange thing is that's happen only using threads.Really? What do you get with this code:
#include <stdio.h>
#include <pthread.h>
class Thread
{
public:
Thread(void) { ; }
virtual ~Thread() { run(); }
virtual void run(void);
};
void Thread::run(void)
{
printf("Base\n");
}
class MyThread : public Thread
{
public:
virtual void run(void);
};
void MyThread::run(void)
{
printf("Derived\n");
}
int main(void)
{
MyThread mt;
}
You need to join the thread *BEFORE* you destroy the object. You
cannot destroy even some of the object while the thread is still
running.
DS