Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-10 Thread voger
Thanks. I tried it and it works. This a really nice trick. I haven't 
thought about using the timer like this.

On 10/03/2016 09:03 πμ, Dietrich Streifert wrote:
> Hi Voger,
>
> wouldn't decoupling the disposal from the event do the magic?
>
> In
> https://github.com/voger/fsmtest/blob/master/source/class/fsmtest/Application.js#L157
>
> Instead of doing
>
>   fsm.dispose()
>   console.log("fsm.isDisposed(): "+ fsm.isDisposed());
>
> I'd do
>
>   qx.event.Timer.once(function() {
>   fsm.dispose();
>   console.log("fsm.isDisposed(): "+ fsm.isDisposed());
>   fsm = null;
>   }, this, 0);
>
> I mean besides all discussion if dispose is needed at all.
>
> Dietrich
>
> Am 09.03.2016 um 21:58 schrieb voger:
>> Thank you. I will just set it null and let GC do it's magic.
>> Just in case it is of any help I created a simple project with the test
>> case from the playground example. I posted it in github
>> https://github.com/voger/fsmtest
>>
>> The problem is this line in qx.util.fsm.FiniteStateMachine
>>
>> this.__savedStates = this.__states = null;
>>
>> When the fsm tries to continue processing the event these arrays are
>> already set to null.
>>
>> BTW I forgot to say thank you for the whole FSM mechanism. It is indeed
>> a great tool that I recently discovered and it will help me to do things
>> I considered very difficult. Thank you. :D
>>
>>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-09 Thread Dietrich Streifert
Hi Voger,

wouldn't decoupling the disposal from the event do the magic?

In 
https://github.com/voger/fsmtest/blob/master/source/class/fsmtest/Application.js#L157

Instead of doing

 fsm.dispose()
 console.log("fsm.isDisposed(): "+ fsm.isDisposed());

I'd do

 qx.event.Timer.once(function() {
 fsm.dispose();
 console.log("fsm.isDisposed(): "+ fsm.isDisposed());
 fsm = null;
 }, this, 0);

I mean besides all discussion if dispose is needed at all.

Dietrich

Am 09.03.2016 um 21:58 schrieb voger:
> Thank you. I will just set it null and let GC do it's magic.
> Just in case it is of any help I created a simple project with the test
> case from the playground example. I posted it in github
> https://github.com/voger/fsmtest
>
> The problem is this line in qx.util.fsm.FiniteStateMachine
>
> this.__savedStates = this.__states = null;
>
> When the fsm tries to continue processing the event these arrays are
> already set to null.
>
> BTW I forgot to say thank you for the whole FSM mechanism. It is indeed
> a great tool that I recently discovered and it will help me to do things
> I considered very difficult. Thank you. :D
>
>


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-09 Thread voger
Thank you. I will just set it null and let GC do it's magic.
Just in case it is of any help I created a simple project with the test 
case from the playground example. I posted it in github 
https://github.com/voger/fsmtest

The problem is this line in qx.util.fsm.FiniteStateMachine

this.__savedStates = this.__states = null;

When the fsm tries to continue processing the event these arrays are 
already set to null.

BTW I forgot to say thank you for the whole FSM mechanism. It is indeed 
a great tool that I recently discovered and it will help me to do things 
I considered very difficult. Thank you. :D


On 09/03/2016 09:20 μμ, Derrell Lipman wrote:
> Yeah, I see. That makes sense.
>
> For now, just set your fsm variable to null. This doesn't help you if
> you're trying to use the dispose debugging, but at least should ensure
> that the memory does actually get garbage collected. At some point, I
> may try to work out how to allow the dispose debugging to work with
> this, but it's a pretty obscure case and is becoming less and less
> necessary as browsers mature anyway.
>
> Cheers,
>
> Derrell
>
>
> On Wed, Mar 9, 2016 at 1:00 PM voger  > wrote:
>
> I did this and the result is that the "terminated" event is not even
> handled. I get this debug line:
>
> 005436 qx.util.fsm.FiniteStateMachine[52-0]: Fsm_1: Cannot listen to
> event 'terminated', because the finite state machine is not running.
>
>
>
> On 08/03/2016 11:42 μμ, Derrell Lipman wrote:
>  > So I've been thinking about this. Although what I told you is
> correct --
>  > modern browsers, and even old ones, should have no problem
> automatically
>  > garbage collecting an FSM because it has no references to DOM objects
>  > and no circular references -- qooxdoo debug display logic could
> still be
>  > applied to disposal. I'm thinking about what needs to change to
> support
>  > that feature.
>  >
>  > Would you please try something for me...
>  >
>  > At qx/util/fsm/FiniteStateMachine.js:1236, change
>  >this.fireDataEvent("terminated", thisState)
>  > to
>  >this.scheduleEvent("terminated", this, thisState);
>  >
>  > Then run your original playground test with your call to
> fsm.dispose().
>  > I'm interested in whether you still see the crash. I don't think you
>  > will, since the fsm processing stack will have unwound at the
> point that
>  > the event fires so it should be safe to dispose.
>  >
>  > (BTW, after calling fsm.dispose(), you should probably /still/ be
>  > setting your fsm variable to null, so that the garbage collector
> can do
>  > its job on the FSM object itself.)
>  >
>  > Derrell
>  >
>  >
>  > On Tue, Mar 8, 2016 at 3:33 PM voger  
>  >  >> wrote:
>  >
>  > Thanks Derrell. It is great to hear from the author itself.
>  >
>  > It's just that I saw in the
> qx.util.fsm.FiniteStateMachine#destruct()
>  > code that it does some clean up functionality and wanted to
> be in the
>  > safe side.
>  >
>  > Plus if I wouldn't understand why it didn't work how I thought it
>  > should, I would literally loose sleep over it. I don't
> exaggerate. I
>  > wasted hours to understand the problem even after you
> suggested that
>  > there was no need to dispose the fsm.
>  >
>  >
>  >
>  >
>  >
>  > On 08/03/2016 07:03 μμ, Derrell Lipman wrote:
>  >  > Right. My suggestion is that you shouldn't need to call
>  > fsm.dispose().
>  >  > Instead, just set
>  >  > fsm = null;
>  >  > so it will be garbage collected. I don't believe there is
>  > anything here
>  >  > that needs "help" with disposing.
>  >  >
>  >  > Here's the modified example: http://tinyurl.com/zxmbrcj
>  >  >
>  >  > Cheers,
>  >  >
>  >  > Derrell
>  >  >
>  >  >
>  >  > On Tue, Mar 8, 2016 at 11:20 AM voger
> 
>  >  >
>  >  >  
>  >    >  >
>  >  > I did a simple example of the problem.
> http://tinyurl.com/zg8nse2
>  >  >
>  >  > After some investigation with the debugger it seems
> that the
>  > problem is
>  >  > the fact that I am trying to dispose the fsm object using
>  

Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-09 Thread Derrell Lipman
Yeah, I see. That makes sense.

For now, just set your fsm variable to null. This doesn't help you if
you're trying to use the dispose debugging, but at least should ensure that
the memory does actually get garbage collected. At some point, I may try to
work out how to allow the dispose debugging to work with this, but it's a
pretty obscure case and is becoming less and less necessary as browsers
mature anyway.

Cheers,

Derrell


On Wed, Mar 9, 2016 at 1:00 PM voger  wrote:

> I did this and the result is that the "terminated" event is not even
> handled. I get this debug line:
>
> 005436 qx.util.fsm.FiniteStateMachine[52-0]: Fsm_1: Cannot listen to
> event 'terminated', because the finite state machine is not running.
>
>
>
> On 08/03/2016 11:42 μμ, Derrell Lipman wrote:
> > So I've been thinking about this. Although what I told you is correct --
> > modern browsers, and even old ones, should have no problem automatically
> > garbage collecting an FSM because it has no references to DOM objects
> > and no circular references -- qooxdoo debug display logic could still be
> > applied to disposal. I'm thinking about what needs to change to support
> > that feature.
> >
> > Would you please try something for me...
> >
> > At qx/util/fsm/FiniteStateMachine.js:1236, change
> >this.fireDataEvent("terminated", thisState)
> > to
> >this.scheduleEvent("terminated", this, thisState);
> >
> > Then run your original playground test with your call to fsm.dispose().
> > I'm interested in whether you still see the crash. I don't think you
> > will, since the fsm processing stack will have unwound at the point that
> > the event fires so it should be safe to dispose.
> >
> > (BTW, after calling fsm.dispose(), you should probably /still/ be
> > setting your fsm variable to null, so that the garbage collector can do
> > its job on the FSM object itself.)
> >
> > Derrell
> >
> >
> > On Tue, Mar 8, 2016 at 3:33 PM voger  > > wrote:
> >
> > Thanks Derrell. It is great to hear from the author itself.
> >
> > It's just that I saw in the qx.util.fsm.FiniteStateMachine#destruct()
> > code that it does some clean up functionality and wanted to be in the
> > safe side.
> >
> > Plus if I wouldn't understand why it didn't work how I thought it
> > should, I would literally loose sleep over it. I don't exaggerate. I
> > wasted hours to understand the problem even after you suggested that
> > there was no need to dispose the fsm.
> >
> >
> >
> >
> >
> > On 08/03/2016 07:03 μμ, Derrell Lipman wrote:
> >  > Right. My suggestion is that you shouldn't need to call
> > fsm.dispose().
> >  > Instead, just set
> >  > fsm = null;
> >  > so it will be garbage collected. I don't believe there is
> > anything here
> >  > that needs "help" with disposing.
> >  >
> >  > Here's the modified example: http://tinyurl.com/zxmbrcj
> >  >
> >  > Cheers,
> >  >
> >  > Derrell
> >  >
> >  >
> >  > On Tue, Mar 8, 2016 at 11:20 AM voger  > 
> >  >  > >> wrote:
> >  >
> >  > I did a simple example of the problem.
> http://tinyurl.com/zg8nse2
> >  >
> >  > After some investigation with the debugger it seems that the
> > problem is
> >  > the fact that I am trying to dispose the fsm object using
> > it's own event
> >  > handler.
> >  >
> >  > A walk through to explain better what I mean:
> >  >
> >  > 1. In the final state I click the "Terminate" button.
> >  > 2. The fsm object picks the "execute" event and starts
> > processing it
> >  > 3. One of the handlers decides to fsm.dispose()
> >  > 4. The fsm isn't done yet with the "execute" event but the
> > fsm it's
> >  > gone now
> >  > 5. Exception
> >  >
> >  >
> >  > An idea how to terminate and dispose the fsm is to use some
> > other event
> >  > not observed by fsm. Something like this example
> >  > http://tinyurl.com/jj7kfxt .
> >  >
> >  >
> >  >
> >  >
> >  >
> >  >
> >  >
> >  >
> >
>  
> --
> >  > Transform Data into Opportunity.
> >  > Accelerate data analysis in your applications with
> >  > Intel Data Analytics Acceleration Library.
> >  > Click to learn more.
> >  > http://makebettercode.com/inteldaal-eval
> >  > ___
> >  > qooxdoo-devel mailing list
> >  > qooxdoo-devel@lists.sourceforge.net
> > 
> >  >  

Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-09 Thread voger
I did this and the result is that the "terminated" event is not even 
handled. I get this debug line:

005436 qx.util.fsm.FiniteStateMachine[52-0]: Fsm_1: Cannot listen to 
event 'terminated', because the finite state machine is not running.



On 08/03/2016 11:42 μμ, Derrell Lipman wrote:
> So I've been thinking about this. Although what I told you is correct --
> modern browsers, and even old ones, should have no problem automatically
> garbage collecting an FSM because it has no references to DOM objects
> and no circular references -- qooxdoo debug display logic could still be
> applied to disposal. I'm thinking about what needs to change to support
> that feature.
>
> Would you please try something for me...
>
> At qx/util/fsm/FiniteStateMachine.js:1236, change
>this.fireDataEvent("terminated", thisState)
> to
>this.scheduleEvent("terminated", this, thisState);
>
> Then run your original playground test with your call to fsm.dispose().
> I'm interested in whether you still see the crash. I don't think you
> will, since the fsm processing stack will have unwound at the point that
> the event fires so it should be safe to dispose.
>
> (BTW, after calling fsm.dispose(), you should probably /still/ be
> setting your fsm variable to null, so that the garbage collector can do
> its job on the FSM object itself.)
>
> Derrell
>
>
> On Tue, Mar 8, 2016 at 3:33 PM voger  > wrote:
>
> Thanks Derrell. It is great to hear from the author itself.
>
> It's just that I saw in the qx.util.fsm.FiniteStateMachine#destruct()
> code that it does some clean up functionality and wanted to be in the
> safe side.
>
> Plus if I wouldn't understand why it didn't work how I thought it
> should, I would literally loose sleep over it. I don't exaggerate. I
> wasted hours to understand the problem even after you suggested that
> there was no need to dispose the fsm.
>
>
>
>
>
> On 08/03/2016 07:03 μμ, Derrell Lipman wrote:
>  > Right. My suggestion is that you shouldn't need to call
> fsm.dispose().
>  > Instead, just set
>  > fsm = null;
>  > so it will be garbage collected. I don't believe there is
> anything here
>  > that needs "help" with disposing.
>  >
>  > Here's the modified example: http://tinyurl.com/zxmbrcj
>  >
>  > Cheers,
>  >
>  > Derrell
>  >
>  >
>  > On Tue, Mar 8, 2016 at 11:20 AM voger  
>  >  >> wrote:
>  >
>  > I did a simple example of the problem. http://tinyurl.com/zg8nse2
>  >
>  > After some investigation with the debugger it seems that the
> problem is
>  > the fact that I am trying to dispose the fsm object using
> it's own event
>  > handler.
>  >
>  > A walk through to explain better what I mean:
>  >
>  > 1. In the final state I click the "Terminate" button.
>  > 2. The fsm object picks the "execute" event and starts
> processing it
>  > 3. One of the handlers decides to fsm.dispose()
>  > 4. The fsm isn't done yet with the "execute" event but the
> fsm it's
>  > gone now
>  > 5. Exception
>  >
>  >
>  > An idea how to terminate and dispose the fsm is to use some
> other event
>  > not observed by fsm. Something like this example
>  > http://tinyurl.com/jj7kfxt .
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>  >
>   
> --
>  > Transform Data into Opportunity.
>  > Accelerate data analysis in your applications with
>  > Intel Data Analytics Acceleration Library.
>  > Click to learn more.
>  > http://makebettercode.com/inteldaal-eval
>  > ___
>  > qooxdoo-devel mailing list
>  > qooxdoo-devel@lists.sourceforge.net
> 
>  >  >
>  > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  >
>  >
>  >
>  >
> 
> --
>  > Transform Data into Opportunity.
>  > Accelerate data analysis in your applications with
>  > Intel Data Analytics Acceleration Library.
>  > Click to learn more.
>  > http://makebettercode.com/inteldaal-eval
>  >
>  >
>  >
>  > ___
>  > qooxdoo-devel mailing list
>  > qooxdoo-devel@lists.sourceforge.net
> 
>  > 

Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-08 Thread Derrell Lipman
So I've been thinking about this. Although what I told you is correct --
modern browsers, and even old ones, should have no problem automatically
garbage collecting an FSM because it has no references to DOM objects and
no circular references -- qooxdoo debug display logic could still be
applied to disposal. I'm thinking about what needs to change to support
that feature.

Would you please try something for me...

At qx/util/fsm/FiniteStateMachine.js:1236, change
  this.fireDataEvent("terminated", thisState)
to
  this.scheduleEvent("terminated", this, thisState);

Then run your original playground test with your call to fsm.dispose(). I'm
interested in whether you still see the crash. I don't think you will,
since the fsm processing stack will have unwound at the point that the
event fires so it should be safe to dispose.

(BTW, after calling fsm.dispose(), you should probably *still* be setting
your fsm variable to null, so that the garbage collector can do its job on
the FSM object itself.)

Derrell


On Tue, Mar 8, 2016 at 3:33 PM voger  wrote:

> Thanks Derrell. It is great to hear from the author itself.
>
> It's just that I saw in the qx.util.fsm.FiniteStateMachine#destruct()
> code that it does some clean up functionality and wanted to be in the
> safe side.
>
> Plus if I wouldn't understand why it didn't work how I thought it
> should, I would literally loose sleep over it. I don't exaggerate. I
> wasted hours to understand the problem even after you suggested that
> there was no need to dispose the fsm.
>
>
>
>
>
> On 08/03/2016 07:03 μμ, Derrell Lipman wrote:
> > Right. My suggestion is that you shouldn't need to call fsm.dispose().
> > Instead, just set
> > fsm = null;
> > so it will be garbage collected. I don't believe there is anything here
> > that needs "help" with disposing.
> >
> > Here's the modified example: http://tinyurl.com/zxmbrcj
> >
> > Cheers,
> >
> > Derrell
> >
> >
> > On Tue, Mar 8, 2016 at 11:20 AM voger  > > wrote:
> >
> > I did a simple example of the problem. http://tinyurl.com/zg8nse2
> >
> > After some investigation with the debugger it seems that the problem
> is
> > the fact that I am trying to dispose the fsm object using it's own
> event
> > handler.
> >
> > A walk through to explain better what I mean:
> >
> > 1. In the final state I click the "Terminate" button.
> > 2. The fsm object picks the "execute" event and starts processing it
> > 3. One of the handlers decides to fsm.dispose()
> > 4. The fsm isn't done yet with the "execute" event but the fsm it's
> > gone now
> > 5. Exception
> >
> >
> > An idea how to terminate and dispose the fsm is to use some other
> event
> > not observed by fsm. Something like this example
> > http://tinyurl.com/jj7kfxt .
> >
> >
> >
> >
> >
> >
> >
> >
>  
> --
> > Transform Data into Opportunity.
> > Accelerate data analysis in your applications with
> > Intel Data Analytics Acceleration Library.
> > Click to learn more.
> > http://makebettercode.com/inteldaal-eval
> > ___
> > qooxdoo-devel mailing list
> > qooxdoo-devel@lists.sourceforge.net
> > 
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
> >
> >
> >
> --
> > Transform Data into Opportunity.
> > Accelerate data analysis in your applications with
> > Intel Data Analytics Acceleration Library.
> > Click to learn more.
> > http://makebettercode.com/inteldaal-eval
> >
> >
> >
> > ___
> > qooxdoo-devel mailing list
> > qooxdoo-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-08 Thread voger
Thanks Derrell. It is great to hear from the author itself.

It's just that I saw in the qx.util.fsm.FiniteStateMachine#destruct() 
code that it does some clean up functionality and wanted to be in the 
safe side.

Plus if I wouldn't understand why it didn't work how I thought it 
should, I would literally loose sleep over it. I don't exaggerate. I 
wasted hours to understand the problem even after you suggested that 
there was no need to dispose the fsm.





On 08/03/2016 07:03 μμ, Derrell Lipman wrote:
> Right. My suggestion is that you shouldn't need to call fsm.dispose().
> Instead, just set
> fsm = null;
> so it will be garbage collected. I don't believe there is anything here
> that needs "help" with disposing.
>
> Here's the modified example: http://tinyurl.com/zxmbrcj
>
> Cheers,
>
> Derrell
>
>
> On Tue, Mar 8, 2016 at 11:20 AM voger  > wrote:
>
> I did a simple example of the problem. http://tinyurl.com/zg8nse2
>
> After some investigation with the debugger it seems that the problem is
> the fact that I am trying to dispose the fsm object using it's own event
> handler.
>
> A walk through to explain better what I mean:
>
> 1. In the final state I click the "Terminate" button.
> 2. The fsm object picks the "execute" event and starts processing it
> 3. One of the handlers decides to fsm.dispose()
> 4. The fsm isn't done yet with the "execute" event but the fsm it's
> gone now
> 5. Exception
>
>
> An idea how to terminate and dispose the fsm is to use some other event
> not observed by fsm. Something like this example
> http://tinyurl.com/jj7kfxt .
>
>
>
>
>
>
>
> 
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
>
>
>
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>


--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-08 Thread Derrell Lipman
Right. My suggestion is that you shouldn't need to call fsm.dispose().
Instead, just set
   fsm = null;
so it will be garbage collected. I don't believe there is anything here
that needs "help" with disposing.

Here's the modified example: http://tinyurl.com/zxmbrcj

Cheers,

Derrell


On Tue, Mar 8, 2016 at 11:20 AM voger  wrote:

> I did a simple example of the problem. http://tinyurl.com/zg8nse2
>
> After some investigation with the debugger it seems that the problem is
> the fact that I am trying to dispose the fsm object using it's own event
> handler.
>
> A walk through to explain better what I mean:
>
> 1. In the final state I click the "Terminate" button.
> 2. The fsm object picks the "execute" event and starts processing it
> 3. One of the handlers decides to fsm.dispose()
> 4. The fsm isn't done yet with the "execute" event but the fsm it's gone
> now
> 5. Exception
>
>
> An idea how to terminate and dispose the fsm is to use some other event
> not observed by fsm. Something like this example
> http://tinyurl.com/jj7kfxt .
>
>
>
>
>
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://makebettercode.com/inteldaal-eval
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-08 Thread voger
I did a simple example of the problem. http://tinyurl.com/zg8nse2

After some investigation with the debugger it seems that the problem is 
the fact that I am trying to dispose the fsm object using it's own event 
handler.

A walk through to explain better what I mean:

1. In the final state I click the "Terminate" button.
2. The fsm object picks the "execute" event and starts processing it
3. One of the handlers decides to fsm.dispose()
4. The fsm isn't done yet with the "execute" event but the fsm it's gone now
5. Exception


An idea how to terminate and dispose the fsm is to use some other event 
not observed by fsm. Something like this example 
http://tinyurl.com/jj7kfxt .







--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] How to dispose a finite state machine?

2016-03-07 Thread Derrell Lipman
The finite state machine doesn't use any DOM element nor anything else that
shouldn't be very normally garbage collected. It (at least theoretically)
shouldn't require any manual disposing. In very old browsers, I think it
needed some help, but I don't think it's required in today's browsers. Be
sure you don't create any closures that prevent it from being garbage
collected. Just set the object reference to null and all should be good.

Derrell


On Sun, Mar 6, 2016 at 5:38 PM voger  wrote:

> I am using qx.util.fsm.FiniteStateMachine to describe the behaviour of
> the "miniapps" that compose the app I am developing. So far I have used
> it in one and it works great. The problem is I don't know how to dispose
> it. When I close the the "miniapp" in the destructor of that class I have
>
> this._fsm.dispose();
>
> but I get exception
>
> "Uncaught TypeError: Cannot read property 'length' of null"
>
> So how can I dispose the fsm?
>
>
> --
> ___
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval___
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel