From: Sven G. <sgo...@ja...> - 2002-04-06 12:54:03
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 06 April 2002 07:03, Kenneth B. Russell wrote: > > The windowClosing method in GLCanvas calls cvsDispose for some reason. > > In my application I only hide a JFrame instead of disposing it on close > > (BTW this is default behavior), but this makes the GLCanvas has dispose > > itself. Now when the JFrame in question is set visible again, the > > GLCanvas is gone. I commented the entire windowClosing implementation in > > GLCanvas out and it seems to work fine. Was there any reason this code > > was put there? It seems to me the GLCanvas will get the windowClosed > > event when a containing window is disposed, so doing dispose on > > windowClosing seems unnecessary. > > I can't answer this definitively but can probably offer some > insight. The OpenGL context needs to be associated with the > underlying widget/HWND/etc. and discarded at the appropriate > time. The problem (as I understand it) is that by the time the > underlying window has been disposed, it's "too late" to dispose > of the OpenGL context since the associated HWND is gone. This is > probably why the OpenGL context is being disposed of eagerly, in > anticipation that the window might get destroyed. There probably > needs to be some sort of re-initialization code put into place > rather than removal of the context cleanup code, or applications > which really do create and destroy GLCanvas objects will have a > memory leak. > > .. and to show the GLCanvas again, i did the latest bugfix within GLCanvas within CVS .. nice documentastion ken: thats the true reason cheers, sven -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8ru/cHdOA30NoFAARAiHFAKCzkpzMmaFmIxZgPWEHLuFsJAFGFACcDb7K d9q0YTFwa3ZxwPRyOD4qR1Y= =hZ26 -----END PGP SIGNATURE----- |