aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin
diff options
context:
space:
mode:
Diffstat (limited to 'src/gwin')
-rw-r--r--src/gwin/gwin_gwin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gwin/gwin_gwin.c b/src/gwin/gwin_gwin.c
index 03902c9b..eb51b89a 100644
--- a/src/gwin/gwin_gwin.c
+++ b/src/gwin/gwin_gwin.c
@@ -16,6 +16,8 @@
#include "gwin_class.h"
+#include <string.h>
+
/*-----------------------------------------------
* Data
*-----------------------------------------------*/
@@ -97,6 +99,10 @@ GHandle _gwindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit
pgw->font = defaultFont;
#endif
+ // Make sure we don't create nasty problems for ourselves
+ if (vmt->size > sizeof(GWindowObject))
+ memset(pgw+1, 0, vmt->size - sizeof(GWindowObject));
+
if (!_gwinWMAdd(pgw, pInit)) {
if ((pgw->flags & GWIN_FLG_DYNAMIC))
gfxFree(pgw);