From 8c47f68f665a400fd0489041d707b4371308a67e Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 15 Jul 2014 13:47:12 +1000 Subject: [PATCH] Only destroy the listener in a frame window if it actually was initialised. --- src/gwin/frame.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gwin/frame.c b/src/gwin/frame.c index c10aaea3..356da3b9 100644 --- a/src/gwin/frame.c +++ b/src/gwin/frame.c @@ -38,8 +38,10 @@ static coord_t BorderSizeT(GHandle gh) { return (gh->flags & GWIN_FRAME_BORDER) static void _frameDestroy(GHandle gh) { /* Deregister the button callback */ - geventRegisterCallback(&gh2obj->gl, NULL, NULL); - geventDetachSource(&gh2obj->gl, NULL); + if ((flags & (GWIN_FRAME_CLOSE_BTN|GWIN_FRAME_MINMAX_BTN))) { + geventRegisterCallback(&gh2obj->gl, NULL, NULL); + geventDetachSource(&gh2obj->gl, NULL); + } /* call the gcontainer standard destroy routine */ _gcontainerDestroy(gh);