Fixed memory leak

This commit is contained in:
Uwe Seimet 2022-02-18 19:24:49 +01:00
parent 5101b7849a
commit 2dbbdcd192

View File

@ -545,7 +545,11 @@ void DetachAll()
{ {
Device *map[devices.size()]; Device *map[devices.size()];
for (size_t i = 0; i < devices.size(); i++) { 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)) { if (MapController(map)) {