From 2662cd51a32cf8292ccce555f64880f460108d2d Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Tue, 28 Mar 2017 13:57:27 +0300 Subject: [PATCH] Fixed sequence of freeing memory. --- src/yolo_v2_class.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yolo_v2_class.cpp b/src/yolo_v2_class.cpp index fb069858..ea13ea34 100644 --- a/src/yolo_v2_class.cpp +++ b/src/yolo_v2_class.cpp @@ -79,9 +79,9 @@ YOLODLL_API Detector::~Detector() for (int j = 0; j < FRAMES; ++j) free(detector_gpu.predictions[j]); for (int j = 0; j < FRAMES; ++j) if(detector_gpu.images[j].data) free(detector_gpu.images[j].data); + for (int j = 0; j < l.w*l.h*l.n; ++j) free(detector_gpu.probs[j]); free(detector_gpu.boxes); free(detector_gpu.probs); - for (int j = 0; j < l.w*l.h*l.n; ++j) free(detector_gpu.probs[j]); int old_gpu_index; cudaGetDevice(&old_gpu_index);