I posted this message to the wxpython-mac list a few days ago, but didn’t receive a response; I’m crossposting it here in hopes that somebody has an idea.
Hi, the attached
code runs fine on Windows (both XP and Vista), but leaks memory and eventually crashes due to runaway memory consumption on Mac OSX 10.6.3, wxPython 2.8.10.1 (mac-unicode), and Python 2.6.4. I’ve narrowed the problem down to something to do with ScreenDC(); for exampe, if I generate an all-red bitmap or something and Blit it using MemoryDC,
it works fine.
I tried a persistent ScreenDC(), which again worked fine on Windows but leaked and crashed on Mac.
I posted this message to the wxpython-mac list a few days ago, but
didn't receive a response; I'm crossposting it here in hopes that
somebody has an idea.
Sorry, I thought I responded to your message there. I must have forgotten to click Send or something...
Hi, the attached code runs fine on Windows (both XP and Vista), but
leaks memory and eventually crashes due to runaway memory consumption on
Mac OSX 10.6.3, wxPython 2.8.10.1 (mac-unicode), and Python 2.6.4. I've
narrowed the problem down to something to do with ScreenDC(); for
exampe, if I generate an all-red bitmap or something and Blit it using
MemoryDC, it works fine.
I tried a persistent ScreenDC(), which again worked fine on Windows but
leaked and crashed on Mac.
Please create a ticket about the memory leak at trac.wxwidgets.org so the right people will see it. However even without the memory leak in wx.ScreenDC the code will likely not work as expected anyway. IIUC, we are not able to get read access to the screen buffer using the CoreGraphics APIs and so the only wxDC type that can successfully be the source of a Blit is wx.MemoryDC and classes derived from it.
Hi, the attached code runs fine on Windows (both XP and Vista), but
leaks memory and eventually crashes due to runaway memory consumption on
Mac OSX 10.6.3, wxPython 2.8.10.1 (mac-unicode), and Python 2.6.4. I’ve
narrowed the problem down to something to do with ScreenDC(); for
exampe, if I generate an all-red bitmap or something and Blit it using
MemoryDC, it works fine.
I tried a persistent ScreenDC(), which again worked fine on Windows but
leaked and crashed on Mac.
Please create a ticket about the memory leak at trac.wxwidgets.org so
the right people will see it. However even without the memory leak in
wx.ScreenDC the code will likely not work as expected anyway. IIUC, we
are not able to get read access to the screen buffer using the
CoreGraphics APIs and so the only wxDC type that can successfully be the
source of a Blit is wx.MemoryDC and classes derived from it.
I should report that except for the memory leak, this code does actually work; that is, I can get screenshots out of it. I’ll look into an OpenGL-based solution or something when I get a chance.
Pete
···
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how.