fixing mem leak by avoiding cyclic ref (when shared_ptr was captured in lambda) (#9930)

This commit is contained in:
Maxim Shevtsov
2022-01-27 10:47:00 +03:00
committed by GitHub
parent 49c2086d23
commit 2b1bacaf6e

View File

@@ -358,7 +358,7 @@ std::pair<AutoBatchExecutableNetwork::WorkerInferRequest&, int> AutoBatchExecuta
auto batch_id = num % _device.batchForDevice;
if (!batch_id) { // need new request
_workerRequests.push_back(std::make_shared<WorkerInferRequest>());
auto workerRequestPtr = _workerRequests.back();
auto workerRequestPtr = _workerRequests.back().get();
workerRequestPtr->_inferRequestBatched = {_network->CreateInferRequest(), _network._so};
workerRequestPtr->_batchSize = _device.batchForDevice;
workerRequestPtr->_completionTasks.resize(workerRequestPtr->_batchSize);