diff options
author | akhropov <[email protected]> | 2025-10-11 03:42:55 +0300 |
---|---|---|
committer | akhropov <[email protected]> | 2025-10-11 03:59:39 +0300 |
commit | 8540915fec03da7728762e86b134048a4201e4c6 (patch) | |
tree | 83e42d156daec8ef4d83bf43ddfc25d13eb3f966 /library/cpp/threading/local_executor | |
parent | 4b376df077e54063f253f0af143635ae2727a6a8 (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.cpp | 4 |
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; } |