jQWidgets Forums

jQuery UI Widgets Forums Dialogs and Notifications Window Need Help with a Memory Leak …

This topic contains 2 replies, has 2 voices, and was last updated by  stephan 11 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Need Help with a Memory Leak … #49628

    stephan
    Participant

    Hi,

    Apparently I have managed to cause a “jqxWindow” related memory leak. I have written a function that dynamically creates a little modal popup jqxWindow (its a Yes/No confirmation dialog) and I try to destroy this dialog after use. After observing that my application leaks memory I found out that this dialog is the cause of the leakage. Each time I create the jqxWindow it appears to register a global “resize” event handler. Via closure this global ‘resize’ event handler prevents not just the entire dialog from garbage collection, but also part of my application that is tied to the dialog. With each time I create the dialog the number of global resize event handler increases by 1. With the help of a debugger you can see that the handlers refer to jQWidgets source code.

    Here you can find a jsfiddle that reproduces the problem:
    http://jsfiddle.net/eG6PT/4/

    With each button click a leaking global resize event handler gets added. I was hoping that because of “closeButtonAction: ‘close'” the popup dialog gets erased completely when closed.

    So I am assuming that I am doing something wrong, which in turn causes my dialog to leak memory, but I can not find out what this is. Could you please help ?

    NOTE: I saw that some of your examples use a single global dialog that they just hide/show, but for my application that would not be a good option. Instead I’d like to create/destroy dialogs as needed.

    Regards,
    Stephan

    Need Help with a Memory Leak … #49630

    Peter Stoev
    Keymaster

    Hi Stephan,

    I will create a work item about that Event Handler. As a temporary workaround, you may just open/close the same window without removing it each time.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Need Help with a Memory Leak … #49634

    stephan
    Participant

    Hi Peter,

    Ok, so I am hoping for a fix. Thanks for looking into this.

    Regards,
    Stephan

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.