Hi,

I am unsure whether I have uncovered an obscure bug or am doing something 
incorrectly, however pyglet appears to hang indefinitely after large number 
of  windows have been created and then disposed off. The minimal code I can 
call to reproduce the behaviour is:

window_count = 0
import pyglet

W = 1280
H = 720
while True:
    window = pyglet.window.Window(H,W,)
    window.close()
    window_count += 1
    print(window_count)


After a  sufficient number of iterations it appears as though the 
`pyglet.window.Window` call will never return or throw an exception. The 
number of iterations that this occurs at depends on the machine I have run 
my test application on, but is somewhere in the region of 65000.

Is there more required to clean up a window object cleanly?

An approach I tried to prevent this from occurring was to reloading the 
pyglet module every 1000 iterations, in the hopes of clearing any dangling 
references to the windows, however this still failed at the same iteration. 
I have also tried reuse windows after the end of the event loop, however 
seemingly `pyglet.app.run()` /  `pyglet.app.stop()` wouldn't work with the 
same window being reused.

My overall aim is to render a batch of sequences one after another, so any 
suggestions as to how reuse the window objects or otherwise structure my 
calls to prevent a large number of windows would be greatly appreciated!

Aled

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyglet-users+unsubscr...@googlegroups.com.
To post to this group, send email to pyglet-users@googlegroups.com.
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to