Destroy engine before graphics (fixes #6857)

This commit is contained in:
Dennis Felsing 2023-07-15 12:30:39 +02:00 committed by Robert Müller
parent 53fad543c0
commit 265eb69284

View file

@ -4694,7 +4694,13 @@ int main(int argc, const char **argv)
{
bool RegisterFail = false;
RegisterFail = RegisterFail || !pKernel->RegisterInterface(pEngine);
RegisterFail = RegisterFail || !pKernel->RegisterInterface(pEngine, false);
CleanerFunctions.push([pEngine]() {
// Has to be before destroying graphics so that skin download thread can finish
delete pEngine;
});
RegisterFail = RegisterFail || !pKernel->RegisterInterface(pConsole);
RegisterFail = RegisterFail || !pKernel->RegisterInterface(pConfigManager);