diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-09-19 08:28:26 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-09-19 08:28:26 +1000 |
commit | 40ec5a4e522450458fac6f4c5c9011623b9fa328 (patch) | |
tree | 94b5d98de2fce0d47a07286eff249e7a5571f99f /src | |
parent | b25ac5e667d98f2915831a74707f6ec198a4498b (diff) | |
download | uGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.tar.gz uGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.tar.bz2 uGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.zip |
Fix bug where freed memory is written to.
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gwin.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 998fb8d3..44d4143c 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -172,10 +172,11 @@ void gwinDestroy(GHandle gh) { gh->vmt->Destroy(gh); // Clean up the structure - if (gh->flags & GWIN_FLG_DYNAMIC) + if (gh->flags & GWIN_FLG_DYNAMIC) { + gh->flags = 0; // To be sure, to be sure gfxFree((void *)gh); - - gh->flags = 0; // To be sure, to be sure + } else + gh->flags = 0; // To be sure, to be sure } const char *gwinGetClassName(GHandle gh) { |