From 86cc16d15dcc929c0b743a789bdc19d9c625bf07 Mon Sep 17 00:00:00 2001 From: Albert S Date: Sun, 29 May 2022 10:40:46 +0200 Subject: [PATCH] gui: IPCPreviewWorker(): Don't allocate mapfunctor on heap --- gui/ipcpreviewworker.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gui/ipcpreviewworker.cpp b/gui/ipcpreviewworker.cpp index 92e32e9..8d39391 100644 --- a/gui/ipcpreviewworker.cpp +++ b/gui/ipcpreviewworker.cpp @@ -10,13 +10,11 @@ IPCPreviewWorker::IPCPreviewWorker() void IPCPreviewWorker::start(RenderConfig config, const QVector &targets, QLocalSocket *peer) { - stop(); - /* TODO: memleak */ - auto mapFunctor = new PreviewGeneratorMapFunctor(); - mapFunctor->setRenderConfig(config); + auto mapFunctor = PreviewGeneratorMapFunctor(); + mapFunctor.setRenderConfig(config); - previewWorkerWatcher.setFuture(QtConcurrent::mapped(targets, *mapFunctor)); + previewWorkerWatcher.setFuture(QtConcurrent::mapped(targets, mapFunctor)); } void IPCPreviewWorker::stop()