Don't delete but call destructor on timeout
Deleting a stack allocated object will cause an immediate crash whereas only calling the destructor will successfully complete the call with a possibility of leaked memory or a crash later on.
This commit is contained in:
@ -1672,7 +1672,7 @@ void *timeout_thread( void *ptr )
|
|||||||
Test->timeout--;
|
Test->timeout--;
|
||||||
}
|
}
|
||||||
Test->tprintf("\n **** Timeout! *** \n");
|
Test->tprintf("\n **** Timeout! *** \n");
|
||||||
delete Test;
|
Test->~TestConnections();
|
||||||
exit(250);
|
exit(250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user