From bbe02b6dfb407346f6860656dc097c2cd431c1e3 Mon Sep 17 00:00:00 2001 From: Wiktor Adamski Date: Tue, 5 Feb 2019 13:17:19 +0100 Subject: [PATCH] Fixed memory leak --- mace/core/runtime/opencl/scratch_image.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mace/core/runtime/opencl/scratch_image.cc b/mace/core/runtime/opencl/scratch_image.cc index df1881c6..fc1ef088 100644 --- a/mace/core/runtime/opencl/scratch_image.cc +++ b/mace/core/runtime/opencl/scratch_image.cc @@ -32,8 +32,8 @@ Image *ScratchImageManager::Spawn( int image_count = static_cast(reference_count_.size()); for (int i = 0; i < image_count; ++i) { int count = reference_count_[i]; - if (count == 0 && images_.at(count)->dtype() == dt) { - auto image_shape = images_.at(count)->shape(); + if (count == 0 && images_.at(i)->dtype() == dt) { + auto image_shape = images_.at(i)->shape(); if (image_shape[0] >= shape[0] && image_shape[1] >= shape[1]) { found_image_idx = i; break; -- GitLab