From 922783b2887fbcee52d2954f05a1664758a0cb27 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 26 Jun 2013 22:48:20 -0400 Subject: [PATCH] DisposeHandle fix (null handles) --- toolbox/mm.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/toolbox/mm.cpp b/toolbox/mm.cpp index db35328..5a2bf3e 100644 --- a/toolbox/mm.cpp +++ b/toolbox/mm.cpp @@ -206,10 +206,12 @@ namespace MM HandleMap.erase(iter); - uint8_t *ptr = info.address + Memory; - - mplite_free(&pool, ptr); + if (info.address) + { + uint8_t *ptr = info.address + Memory; + mplite_free(&pool, ptr); + } HandleQueue.push_back(handle); return SetMemError(0);