aboutsummaryrefslogtreecommitdiffstats
path: root/src
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:49 +1000
commitbbed625a2aacb312bb0767292f1cb08baf2a7a75 (patch)
tree2cd836527dcbcc8fc3739820c775367c860e1c61 /src
parent15a09de6592ec8548057f640eb16c452ac9fa296 (diff)
downloaduGFX-bbed625a2aacb312bb0767292f1cb08baf2a7a75.tar.gz
uGFX-bbed625a2aacb312bb0767292f1cb08baf2a7a75.tar.bz2
uGFX-bbed625a2aacb312bb0767292f1cb08baf2a7a75.zip
Fix bug where freed memory is written to.
Diffstat (limited to 'src')
-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) {