I got my code like the following:
class TimeManager
{
public:
virtual ~TimeManager();
};
class UserManager : virtual public TimeManager
{
public:
virtual ~UserManager();
};
class Server : virutal public UserManager
{
virtual ~Server();
};
CServer *pServer;
DWORD WINAPI ServerHelper(void*);
int main()
{
//Create server
CreateThread(NULL, 0, ServerHelper, NULL, 0, NULL);
std::cin.get();
//delete server
delete pServer;
std::cin.get();
return 0;
}
DWORD WINAPI ServerHelper(void *v)
{
pServer = new CServer;
return 0;
}
My Problem is - guess - that my Server destrcutor won´t get called...
I can´t imagine, why:/... (I wrote output functions into all three classes and the server constructor does not output anything, but both of the other does... right after the SECOND! key-hit... (why the second and not right after the deletion?)
Any hints, tips, solutions?....
I am using visual studio 2010