PyAssertionError while creating a buffered dc

In one of my applications, the user can open projects one at a time, or
can open any number of projects at once.

When the user opens a group of projects one at a time (keeping all
projects open throughout), everything works as expected. But when
the user tries to open that same number of projects (usually nine or ten
or more) all at once, i.e., in a project-opening loop, both the
application and Python itself bomb, always in the same place:

` dc = wx.BufferedDC(wx.ClientDC(self),
self.buffer)

File
“C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx_gdi.py”,
line 4825, in init

gdi.BufferedDC_swinginit(self,gdi.new_BufferedDC(*args))

wx._core.PyAssertionError: C++ assertion “m_refData &&
m_refData->GetRefCount() == 1” failed at
…\src\common\object.cpp(347) in wxObject::AllocExclusive():
wxObject::AllocExclusive() failed.

self.buffer` was created earlier:

` self.buffer =
wx.EmptyBitmap(size.width, size.height)

`I’d love to provide a “small runnable example illustrating the
problem,” but am unable to do so.

Any ideas as to what I might do to identify, isolate, and eliminate this
problem?

Bob