From 534da7a270994c4163b9d08e3daf739109c52226 Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Mon, 23 Oct 2017 19:01:09 +0000 Subject: [PATCH] clear window workmask when queuing up window for destruction. All callbacks (except destroy) are removed from the window already anyway. This fixes a problem where a newly created window that is immediately destroyed again causes an error-exit because it is still being inited and at that point it is found that no display callback has been set, which is an error. git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1837 7f0cb862-5218-0410-a997-914c9d46530a --- src/fg_structure.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fg_structure.c b/src/fg_structure.c index 4274667..0fee95d 100644 --- a/src/fg_structure.c +++ b/src/fg_structure.c @@ -182,6 +182,11 @@ void fgAddToWindowDestroyList( SFG_Window* window ) fghClearCallBacks( window ); SET_WCB( *window, Destroy, destroy, destroyData ); } + + /* + * Similarly, clear all work set for the window, none of this has to be executed anymore + */ + window->State.WorkMask = 0; } /* -- 1.7.10.4