From 2dbbdcd192280317193cea80691bda40ed073d10 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 18 Feb 2022 19:24:49 +0100 Subject: [PATCH] Fixed memory leak --- src/raspberrypi/rascsi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 4bb6ff12..150b9733 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -545,7 +545,11 @@ void DetachAll() { Device *map[devices.size()]; for (size_t i = 0; i < devices.size(); i++) { - map[i] = NULL; + Device *device = map[i]; + if (device) { + delete device; + map[i] = NULL; + } } if (MapController(map)) {