aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/gwin.c
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-09-19 08:28:26 +1000
committerinmarket <andrewh@inmarket.com.au>2013-09-19 08:28:26 +1000
commit40ec5a4e522450458fac6f4c5c9011623b9fa328 (patch)
tree94b5d98de2fce0d47a07286eff249e7a5571f99f /src/gwin/gwin.c
parentb25ac5e667d98f2915831a74707f6ec198a4498b (diff)
downloaduGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.tar.gz
uGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.tar.bz2
uGFX-40ec5a4e522450458fac6f4c5c9011623b9fa328.zip
Fix bug where freed memory is written to.
Diffstat (limited to 'src/gwin/gwin.c')
-rw-r--r--src/gwin/gwin.c7
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) {