You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Brian Raymes <br...@teotech.com> on 2021/06/23 19:37:08 UTC

Crux Not Cleaning Up EventHandlers Upon Tear Down?

Hi all,

I have a puzzling situation. I am dynamically adding crux views that contain reusable components that contain EventHandler tags. When I remove said component and add another, the previous instance of the Crux EventHandler is not removed. Instead, another is added.

Destroying that view by tearing down the bean does not seem to remove the EventHandler that was previously associated. Instead, the new view adds another, then subsequent dispatched events now invoke the EventHandler twice. Destroy and add another, then three times, etc.

Is this expected? Is there away to force the EventHandler to cleanup? Should I be using the Prototype class to instantiate single instances? If so, can someone point me towards how that can be done on the fly?


Thank you.

Brian


Re: Crux Not Cleaning Up EventHandlers Upon Tear Down?

Posted by "romanisitua@yahoo.com.INVALID" <ro...@yahoo.com.INVALID>.
Good Day,
I am commenting on this your mail  based on your comment that you did the port from swiz to crux. I have a question I want to ask about crux

I am new to royale. I have no prior flex knowledge either. I am currently learning actionscript and royale. I intend to use royale as the default front end for my applications going forward.  I am coming from a server side java ui background namely jsf and more recently ZK.
With ZK I used the presentation model (mvvm) design pattern extensively.  My decision to learn royale was actually based on my discovery that swiz the flex framework supported presentation model and that crux is a port of swiz.

So my question is the presentation model supported in crux ? I am asking because the examples on crux in github use the mvc approach. So I want  to ask if the presentation model is supported.


Regards,

Roman,
Sent from Yahoo Mail on Android 
 
  On Thu, 24 Jun 2021 at 8:33, Greg Dove<gr...@gmail.com> wrote:   Hi Hiedra, Brian,

I did most of the work on Crux porting, and it's entirely possible there
are bugs in the port. Feel free to open a github issue. It will be easier
for me to work on it if there is a minimal repro fileset that you can
attach to the issue. If something relied on weak listeners in the original
Swiz, it could be part of the reason, but I would need to try to compare
and debug swiz vs. crux to check. I'd be happy to look into it but I am
unlikely to be able to get to it until July 3 or 4 because of other
commitments.

Greg



On Thu, 24 Jun 2021, 7:09 pm Maria Jose Esteve, <mj...@iest.com> wrote:

> Hi Brian, it happens to me too and I have not managed to solve it. In my
> case, I include the mxml instantiation is maintained, maybe because it does
> the crux.... link.
>
> Hiedra.
>
> -----Mensaje original-----
> De: Brian Raymes <br...@teotech.com>
> Enviado el: miércoles, 23 de junio de 2021 21:37
> Para: dev@royale.apache.org
> Asunto: Crux Not Cleaning Up EventHandlers Upon Tear Down?
>
> Hi all,
>
> I have a puzzling situation. I am dynamically adding crux views that
> contain reusable components that contain EventHandler tags. When I remove
> said component and add another, the previous instance of the Crux
> EventHandler is not removed. Instead, another is added.
>
> Destroying that view by tearing down the bean does not seem to remove the
> EventHandler that was previously associated. Instead, the new view adds
> another, then subsequent dispatched events now invoke the EventHandler
> twice. Destroy and add another, then three times, etc.
>
> Is this expected? Is there away to force the EventHandler to cleanup?
> Should I be using the Prototype class to instantiate single instances? If
> so, can someone point me towards how that can be done on the fly?
>
>
> Thank you.
>
> Brian
>
>
  

Re: Crux Not Cleaning Up EventHandlers Upon Tear Down?

Posted by Greg Dove <gr...@gmail.com>.
Hi Hiedra, Brian,

I did most of the work on Crux porting, and it's entirely possible there
are bugs in the port. Feel free to open a github issue. It will be easier
for me to work on it if there is a minimal repro fileset that you can
attach to the issue. If something relied on weak listeners in the original
Swiz, it could be part of the reason, but I would need to try to compare
and debug swiz vs. crux to check. I'd be happy to look into it but I am
unlikely to be able to get to it until July 3 or 4 because of other
commitments.

Greg



On Thu, 24 Jun 2021, 7:09 pm Maria Jose Esteve, <mj...@iest.com> wrote:

> Hi Brian, it happens to me too and I have not managed to solve it. In my
> case, I include the mxml instantiation is maintained, maybe because it does
> the crux.... link.
>
> Hiedra.
>
> -----Mensaje original-----
> De: Brian Raymes <br...@teotech.com>
> Enviado el: miércoles, 23 de junio de 2021 21:37
> Para: dev@royale.apache.org
> Asunto: Crux Not Cleaning Up EventHandlers Upon Tear Down?
>
> Hi all,
>
> I have a puzzling situation. I am dynamically adding crux views that
> contain reusable components that contain EventHandler tags. When I remove
> said component and add another, the previous instance of the Crux
> EventHandler is not removed. Instead, another is added.
>
> Destroying that view by tearing down the bean does not seem to remove the
> EventHandler that was previously associated. Instead, the new view adds
> another, then subsequent dispatched events now invoke the EventHandler
> twice. Destroy and add another, then three times, etc.
>
> Is this expected? Is there away to force the EventHandler to cleanup?
> Should I be using the Prototype class to instantiate single instances? If
> so, can someone point me towards how that can be done on the fly?
>
>
> Thank you.
>
> Brian
>
>

RE: Crux Not Cleaning Up EventHandlers Upon Tear Down?

Posted by Maria Jose Esteve <mj...@iest.com>.
Hi Brian, it happens to me too and I have not managed to solve it. In my case, I include the mxml instantiation is maintained, maybe because it does the crux.... link.

Hiedra.

-----Mensaje original-----
De: Brian Raymes <br...@teotech.com> 
Enviado el: miércoles, 23 de junio de 2021 21:37
Para: dev@royale.apache.org
Asunto: Crux Not Cleaning Up EventHandlers Upon Tear Down?

Hi all,

I have a puzzling situation. I am dynamically adding crux views that contain reusable components that contain EventHandler tags. When I remove said component and add another, the previous instance of the Crux EventHandler is not removed. Instead, another is added.

Destroying that view by tearing down the bean does not seem to remove the EventHandler that was previously associated. Instead, the new view adds another, then subsequent dispatched events now invoke the EventHandler twice. Destroy and add another, then three times, etc.

Is this expected? Is there away to force the EventHandler to cleanup? Should I be using the Prototype class to instantiate single instances? If so, can someone point me towards how that can be done on the fly?


Thank you.

Brian