Fix segfault on quitting with open node formspec (#8608)
authorSmallJoker <mk939@ymail.com>
Fri, 21 Jun 2019 19:00:30 +0000 (21:00 +0200)
committerSmallJoker <mk939@ymail.com>
Fri, 21 Jun 2019 19:00:30 +0000 (21:00 +0200)
src/client/gameui.cpp

index f3c3fefb6e436436426eceb2e76c9095b6085843..33f7d1a8ad7b976841f891a8692d1a69e2bcf4f6 100644 (file)
@@ -306,11 +306,10 @@ void GameUI::toggleProfiler()
 
 void GameUI::deleteFormspec()
 {
-       if (m_formspec)
-               m_formspec->quitMenu();
-
-       delete m_formspec;
-       m_formspec = nullptr;
+       if (m_formspec) {
+               m_formspec->drop();
+               m_formspec = nullptr;
+       }
 
        m_formname.clear();
 }