From 6d272d8a5a9775bb22c92de2d8e54bcd2432eb84 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 1 Dec 2015 23:25:04 +1100 Subject: [PATCH] Fixed crash when quicly exiting stk after refreshing the server list. --- src/states_screens/server_selection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/states_screens/server_selection.cpp b/src/states_screens/server_selection.cpp index 4e8841e42..dbf2f89e6 100644 --- a/src/states_screens/server_selection.cpp +++ b/src/states_screens/server_selection.cpp @@ -54,7 +54,12 @@ ServerSelection::~ServerSelection() */ void ServerSelection::tearDown() { - delete m_refresh_request; + // If the refresh request is being executed, and stk should exit, + // then a crash can happen when the refresh request is deleted, but + // then the request manager tries to activate this request. So only + // delete this request if it is finished. + if(m_refresh_request && m_refresh_request->isDone()) + delete m_refresh_request; } // tearDown // ----------------------------------------------------------------------------