Skip to content

Instantly share code, notes, and snippets.

@kevinw
Created January 13, 2011 19:18
Show Gist options
  • Save kevinw/778422 to your computer and use it in GitHub Desktop.
Save kevinw/778422 to your computer and use it in GitHub Desktop.
def test_subthread_delete():
app = wx.GetApp()
t, t2 = wx.Timer(), wx.Timer()
t.t = t2
t2.t = t
timers = [t, t2]
del t, t2
from threading import Thread
def subthread():
del timers[:]
gc.collect()
assert 2 == len(app.pendingDelete)
t = Thread(target=subthread)
t.start()
wx.flush_pending_delete()
assert 0 == len(app.pendingDelete)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment