mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Fix crash on closing game during background image upscaling
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "../GameEngine.h"
|
||||
#include "../render/IScreenHandler.h"
|
||||
|
||||
#include "../../lib/AsyncRunner.h"
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
@@ -256,8 +257,6 @@ std::shared_ptr<const ISharedImage> SDLImageShared::scaleInteger(int factor, SDL
|
||||
|
||||
SDLImageShared::SDLImageShared(const SDLImageShared * from, int integerScaleFactor, EScalingAlgorithm algorithm)
|
||||
{
|
||||
static tbb::task_arena upscalingArena;
|
||||
|
||||
upscalingInProgress = true;
|
||||
|
||||
auto scaler = std::make_shared<SDLImageScaler>(from->surf, Rect(from->margins, from->fullSize), true);
|
||||
@@ -273,7 +272,7 @@ SDLImageShared::SDLImageShared(const SDLImageShared * from, int integerScaleFact
|
||||
};
|
||||
|
||||
if(settings["video"]["asyncUpscaling"].Bool())
|
||||
upscalingArena.enqueue(scalingTask);
|
||||
ENGINE->async().run(scalingTask);
|
||||
else
|
||||
scalingTask();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user