On Sat, Nov 15, 2008 at 9:02 PM, John Labenski <[EMAIL PROTECTED]> wrote: > On Sat, Nov 15, 2008 at 2:58 AM, Eero Pajarre <[EMAIL PROTECTED]> wrote: >> >> Just wanted to tell about my own experience, which I told on this >> mailing list in June. wxTimers can be garbage collected even if they >> are in use. So if you use timers you might want to check for that >> possibility. >> > > Could you elaborate? There is no reason why a wxTimer should be > deleted and not a wxPoint for the same code. >
Sorry I didn't want to say that I considered the behaviour wrong. I just wanted mention this because it managed to confuse me for a while when it happened in my code. > To be sure, you cannot create anything you want to outlive the current > scope with the "local" keyword since it will be GCed. It may be that one of things which led to my confusion was that with GUI objects you can let their "Lua variables" to go out of their scope if they have been added to an other GUI object. This association is enough for keeping them alive (and actually it appears that a visible frame is not collected, even if its Lua variable goes out of scope) But the fact that the timer is live (creating timer events), will not save it from GC. And of course after I realised that my timer will get collected I was able to avoid that. It just took some time to realise... My wxLua main program forces gc_step so often that my timer never had time to trigger, so I thought that it was not working at all. btw. even after some reconsidering I think that the way how it works, is the correct/better behaviour for timers Eero ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users