From 1c5e1b705c36e4934a6dd0af6587c08e65321a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 29 Jun 2017 13:36:24 +0300 Subject: [PATCH] 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. --- maxscale-system-test/testconnections.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index bb112901f..f10e5d7d5 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -1672,7 +1672,7 @@ void *timeout_thread( void *ptr ) Test->timeout--; } Test->tprintf("\n **** Timeout! *** \n"); - delete Test; + Test->~TestConnections(); exit(250); }