John Labenski <jlaben...@gmail.com> wrote: (04/05/2009 22:06) >>> On Sat, Apr 25, 2009 at 1:11 PM, lostgallifreyan >>> <lostgallifre...@...> wrote: >> >> One thing I've noticed is that when loading a large bitmap, I get one or >> two shots at it providing each load and close of the program is clean. >> If I try too soon the bitmap loads but is not displayed! Conversely if I >> leave the program sitting for a while, I can expect to close and reload >> and have it display more that twice per session without reboot. If it borks >> and fails to display, that's it, end of session, need reboot. (This is W98 >> SE). I have tried collectgarbage("collect") at various points already during >> yesterday's work, without results, but the fact that I can wait a while and >> thus get clearance to load it again safely imp;ies that some sort of garbage >> collection might be happening, and possibly in Windows itself? If you have >> any thoughts that might help track down a way to invoke it manually, it coule >> allow me to safely load a huge image any number of times without causing that >> display failure. One other clue: I've seen similar errors in other programs, >> which is why I'm convinced this is something in Windows. Crucially, tools >> like Paint Shop appear to be able to reload the image as often as I like >> without error, so that implies there IS a way, though whether it's something >> wxLua can reach I don't know yet. >> > >You must also delete any wxBitmaps as they are also MSW GDI objects. > >There's more about this here: >http://wxlua.sourceforge.net/docs/wxlua.html >search for "Must delete if > 50 : wxBitmap" >
It's huge, so I already put emphasis on deleting at first chance. I found that I had to keep it while displaying it. That's significant because that confirms it's stored as the actual bitmap for display, not elsewhere allowing me to delete it early while still seeing it. Actually it does show me the current screenful but scrolling shows that the source data is gone is I delete it too early, so even that remaining screenful would not survive a refresh.. I found the only point for deletion seems to be at closure, so I put BITMAP:delete() BITMAP=nil into the event handling for any closure of the program. I also select a wx.wxNullBitmap into any DC before deleting the DC immediately after use. Is there anything more that can be done? All this has not so far prevented the failed rendering on large images after just one or two program loads. I've even taken to deleting wxPoints because plenty of those accumulate while scrolling. The only thing that helps is to wait a long time after loading before closing, that usually lets me get at least one more load before the display fails to render an image. I notice that scrolling during that long wait does not affect this extension of session. It seems to me that Windows itself has some kind of inbuilt garbage collection, something that might be invoked by API that perhaps wxWidgets does not invoke. It seems that few programmers in ANY system (MFC, whatever) invoke, but the fact that some (like Paint Shop) do allow repeated loads with no trouble proves that it is possible, somehow. ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users