Hi,
First-time posting, so apologies in advance for any etiquette failings.
I have a wx GUI in which the user opens and closes various AGW-managed notebooks. After extended use the program crashes, which I’ve tracked-down to hitting the Windows GDI Object limit. My program has no need for this many objects - it just seems they’re just not being cleaned-up when panes and notebooks are closed.
My wx version is “4.0.6 msw (phoenix) wxWidgets 3.0.5” (Python 3.7.3). I’ve also seen the same behavior on wx 4.0.3 (Python 3.6.7).
I’ve tried to hunt online for solutions, and found a couple of references to similar problems, such as these from 2013 (I’m not a software developer by training, so this is really pushing my limits):
http://wxpython-users.1045709.n5.nabble.com/AGW-AuiNotebook-and-memory-management-td5719108.html
and http://trac.wxwidgets.org/ticket/14670
It’s not clear to me if this is the same issue, and if it is, whether it was ever successfully fixed. Maybe I’m just closing the gui elements in the wrong way, and causing the mess myself?!
I’ve attached an example code which shows the problem and also for convenience reports memory and GDI usage in the statusbar. When you run it, go to the Options menu and just create and then delete the panes, and watch the GDI usage rise.
Many thanks for any help you can provide, and please let me know if there’s any additional info I should have provided.
Nev.
GDI demo.py (3.2 KB)