The deferred window destruction code was destroying the windows in reverse
authorChristopher John Purnell <cjp@lost.org.uk>
Thu, 11 Dec 2003 21:29:43 +0000 (21:29 +0000)
committerChristopher John Purnell <cjp@lost.org.uk>
Thu, 11 Dec 2003 21:29:43 +0000 (21:29 +0000)
commit612f817ef1b975ede61b5cd6b880822b66207b76
tree6d655515eb64e8db71823a3ae5419386257177cc
parent3395341640d3cbea619843270da92edfca0cb324
The deferred window destruction code was destroying the windows in reverse
order.  This cased a crash when the call to glutDestroyWindow() for a sub
windows was immediately followed by a call to glutDestroyWindow() for it's
parent. fgCloseWindows() would call fgDestroyWindow() for the parent first
fgDestroyWindws() would recurse over the children and then fgCloseWindows()
would call fgDestroyWindow() again for the child.

I've replaced the single linked list with one of our two way link list
structures.  I've also moved it into fgStructure because that seemed the
consistent thing to do.

I said the the deferred windows destruction causes more problems then it
solves.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@396 7f0cb862-5218-0410-a997-914c9d46530a
src/freeglut_internal.h
src/freeglut_structure.c