Just a not-so-very-side-note. Recursively calling setTimeout to accomplish
exactly what setInterval is meant to do is not a good idea no matter what.
It's an old habit of all JS developers, but it's simply an abuse with
occasionally bad repercussions (leading to memory leaks when confronted with
bad code if nothing else). The this re-reference as a local var is a great
suggestion (and should solve your immediate issue as this in the context
window when triggered by window.setTimeout), but I would augment it.

_maintainSession: function() {
            var self = this;
            var interval = setInterval(function() { 
             if(self.getUserData("polling")) { 
                    self.fireApplicationEvent("maintainsession", { 
                        a: self.getUserData("a") 
                    }); 
                } else {
                    // Am i right to assume that you are looking to cancel
the keep-alive if something unexpected happens?
                    clearInterval(interval);
                    // Do what ever else to clean up session here. Display
message, etc.
                }
        }, 60000);


--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/too-much-recursion-using-setTimeout-tp6294647p6298698.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to