summaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/local_executor
diff options
context:
space:
mode:
authorakhropov <[email protected]>2025-10-11 03:42:55 +0300
committerakhropov <[email protected]>2025-10-11 03:59:39 +0300
commit8540915fec03da7728762e86b134048a4201e4c6 (patch)
tree83e42d156daec8ef4d83bf43ddfc25d13eb3f966 /library/cpp/threading/local_executor
parent4b376df077e54063f253f0af143635ae2727a6a8 (diff)
Fix a potential memory leak
commit_hash:17b4088b80f1a7446525ed8eebf0566b3e3a7888
Diffstat (limited to 'library/cpp/threading/local_executor')
-rw-r--r--library/cpp/threading/local_executor/local_executor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/cpp/threading/local_executor/local_executor.cpp b/library/cpp/threading/local_executor/local_executor.cpp
index 107f981ff70..79361b3a769 100644
--- a/library/cpp/threading/local_executor/local_executor.cpp
+++ b/library/cpp/threading/local_executor/local_executor.cpp
@@ -325,9 +325,9 @@ void NPar::ILocalExecutor::ExecRangeWithThrow(TLocallyExecutableFunction exec, i
TVector<NThreading::TFuture<void>>
NPar::ILocalExecutor::ExecRangeWithFutures(TLocallyExecutableFunction exec, int firstId, int lastId, int flags) {
- TFunctionWrapperWithPromise* execWrapper = new TFunctionWrapperWithPromise(exec, firstId, lastId);
+ auto execWrapper = MakeIntrusive<TFunctionWrapperWithPromise>(exec, firstId, lastId);
TVector<NThreading::TFuture<void>> out = execWrapper->GetFutures();
- ExecRange(execWrapper, firstId, lastId, flags);
+ ExecRange(std::move(execWrapper), firstId, lastId, flags);
return out;
}