[richfaces-issues] [JBoss JIRA] Work stopped: (RF-6027) ModalPanel: incomplete cleanup at destroy method

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Tue Mar 31 13:29:23 EDT 2009


     [ https://jira.jboss.org/jira/browse/RF-6027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on RF-6027 stopped by Nick Belaevski.

> ModalPanel: incomplete cleanup at destroy method
> ------------------------------------------------
>
>                 Key: RF-6027
>                 URL: https://jira.jboss.org/jira/browse/RF-6027
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.2.2
>         Environment: IE7
>            Reporter: Sergey Astakhov
>            Assignee: Nick Belaevski
>             Fix For: 3.3.1
>
>
> Extracts from modalPanel.js:
> show():
> ...
> if (this.options.autosized) {
>   this.observerSize =
>     window.setInterval(this.correctShadowSize.bindAsEventListener(this), 500);
> }
> ...
> hide():
> ...
> if (this.options.autosized) {
>   window.clearInterval(this.observerSize);
> }
> ...
> You are setting up timer listener when ModalPanel is displayed, and clear it when hiding. All works fine when show() is paired with hide(), but there is exist a possibilities when region with panel is replaced by ajax response, then on panel is called only the destroy() method, but not hide(). In this case timer is rest in memory and cause flickering of shadow of panel if you try to display the panel (replaced by ajax) again (and may cause memory leaks).
> As workaround I tried to include cleanup code in destroy() method:
> ---
> ModalPanel.prototype.originalModalDestroy = ModalPanel.prototype.destroy;
> ModalPanel.prototype.destroy = function(id, options)
> {
>   if( this.shown && this.options.autosized )
>   {
>     window.clearInterval(this.observerSize);
>   }
>   return this.originalModalDestroy(id, options);
> };
> ---
> After this change the problems seems to gone away. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list