According to all the wxPython examples I see, Dialogs
should be Destroy()ed explicitly when you're done with
them. I've got that, but is there anything else we
should Destroy()?
The reason I ask is that I'm doing my first program
that requires a wxMemoryDC for off-screen painting. I
didn't like the idea of creating a new wxEmptyBitmap
and wxMemoryDC with every screen update (it seems like
this would cause memory to thrash a lot more than just
keeping one of each around). So I just made these
members of my Panel. Hopefully no one out there in
'net-land is screaming "DON'T DO THAT!" just yet. If
so, please explain why, so that I'll know.
This seems to work just fine *IF* I create a new
bitmap when the window size changes. Resizing the
bitmap didn't seem to work. No biggie. However, due
an abundance of caution, I did try doing a Destroy()
on the old bitmap before creating the new one. You
can go ahead and scream "DON'T DO THAT!" now. That
crashes things pretty hard.
I'm fine with not Destroy()ing wxBitmap's, but I want
to know more. Why shouldn't I? What should I
Destroy()? I generally just Destroy() dialogs and let
the rest of it take care of itself. Is that okay?
Thanks,
Gre7g
···
____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html