Loading ...
Sorry, an error occurred while loading the content.

Dialog mask not cleaning up memory leak

Expand Messages
  • jamoville
    I found a post that indicated a memory leak happens when a mask was used with a dialog. I also found that there was a patch for this but I m working with the
    Message 1 of 6 , Feb 28, 2007
    • 0 Attachment
      I found a post that indicated a memory leak happens when a mask was
      used with a dialog. I also found that there was a patch for this
      but I'm working with the latest code and I don't think this is
      working. In the container.js file there is a destroy : function()
      for a Module that should be called by the
      YAHOO.widget.Overlay.superclass.destroy.call(this); method. This
      will fire the destroyEvent which will clean up the mask in the
      following method
      YAHOO.widget.Panel.prototype.removeMask

      None of this appears to ever happen. In order for this chain of
      events to happen the
      YAHOO.widget.Overlay.prototype.destroy
      method needs to be called but I don't see that ever happening. I
      even went so far as putting an alert box in these methods to make
      sure I wasn't missing the call but none of this is executing. I see
      this as a big memory leak in my application. This seems like a
      pretty bad thing - any ideas on why this clean up code isn't
      happening?

      Thanks
    • Todd Kloots
      jamoville - I just tested with version 2.2.0 of container.js and calling destroy on a YAHOO.widget.Panel instance does result in a call to both the
      Message 2 of 6 , Feb 28, 2007
      • 0 Attachment
        "jamoville" -

        I just tested with version 2.2.0 of container.js and calling "destroy" on a YAHOO.widget.Panel instance does result in a call to both the "destroy" methods of YAHOO.widget.Overlay and YAHOO.widget.Module as well as YAHOO.widget.Panel.prototype.removeMask. Can you provide a URL to a page that reproduces the leak so that I can take a look? If there is in fact a memory leak caused by container.js I'd be more than happy to help you fix it.

        Thanks,
        Todd

        ----- Original Message ----
        From: jamoville <john.hutchinson@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Wednesday, February 28, 2007 9:43:11 AM
        Subject: [ydn-javascript] Dialog mask not cleaning up memory leak

        I found a post that indicated a memory leak happens when a mask was
        used with a dialog. I also found that there was a patch for this
        but I'm working with the latest code and I don't think this is
        working. In the container.js file there is a destroy : function()
        for a Module that should be called by the
        YAHOO.widget.Overlay.superclass.destroy.call(this); method. This
        will fire the destroyEvent which will clean up the mask in the
        following method
        YAHOO.widget.Panel.prototype.removeMask

        None of this appears to ever happen. In order for this chain of
        events to happen the
        YAHOO.widget.Overlay.prototype.destroy
        method needs to be called but I don't see that ever happening. I
        even went so far as putting an alert box in these methods to make
        sure I wasn't missing the call but none of this is executing. I see
        this as a big memory leak in my application. This seems like a
        pretty bad thing - any ideas on why this clean up code isn't
        happening?

        Thanks




        Yahoo! Groups Links
      • jamoville
        Ok - This may be a problem with my understanding of the use of dialogs then. It s true that calling destroy on the panel instance does result in a the
        Message 3 of 6 , Feb 28, 2007
        • 0 Attachment
          Ok - This may be a problem with my understanding of the use of
          dialogs then. It's true that calling destroy on the panel instance
          does result in a the subsequent calls to clean things up. I guess
          what I was expecting was that a call to cancel the dialog should do
          this for you and here is why I was thinking this. If I display a
          dialog to the user and they hit the cancel or the x button to cancel
          the dialog, the dialog goes away. If the destroy is not called
          automatically at the time of the cancel then the cleanup never
          happens and the memory is not cleaned up.

          I guess what your saying is that canceling a dialog does nothing
          more than hiding it from the user. Clean up will only happen if the
          cancel is detected and a call to destroy is done.

          Does this explanation explain what should be happening? If so - I
          will subscribe to the cancel on all of my dialogs.

          Thanks again.


          --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...>
          wrote:
          >
          > "jamoville" -
          >
          > I just tested with version 2.2.0 of container.js and
          calling "destroy" on a YAHOO.widget.Panel instance does result in a
          call to both the "destroy" methods of YAHOO.widget.Overlay and
          YAHOO.widget.Module as well as
          YAHOO.widget.Panel.prototype.removeMask. Can you provide a URL to a
          page that reproduces the leak so that I can take a look? If there
          is in fact a memory leak caused by container.js I'd be more than
          happy to help you fix it.
          >
          > Thanks,
          > Todd
          >
          > ----- Original Message ----
          > From: jamoville <john.hutchinson@...>
          > To: ydn-javascript@yahoogroups.com
          > Sent: Wednesday, February 28, 2007 9:43:11 AM
          > Subject: [ydn-javascript] Dialog mask not cleaning up memory leak
          >
          > I found a post that indicated a memory leak happens when a mask
          was
          > used with a dialog. I also found that there was a patch for this
          > but I'm working with the latest code and I don't think this is
          > working. In the container.js file there is a destroy : function()
          > for a Module that should be called by the
          > YAHOO.widget.Overlay.superclass.destroy.call(this); method. This
          > will fire the destroyEvent which will clean up the mask in the
          > following method
          > YAHOO.widget.Panel.prototype.removeMask
          >
          > None of this appears to ever happen. In order for this chain of
          > events to happen the
          > YAHOO.widget.Overlay.prototype.destroy
          > method needs to be called but I don't see that ever happening. I
          > even went so far as putting an alert box in these methods to make
          > sure I wasn't missing the call but none of this is executing. I
          see
          > this as a big memory leak in my application. This seems like a
          > pretty bad thing - any ideas on why this clean up code isn't
          > happening?
          >
          > Thanks
          >
          >
          >
          >
          > Yahoo! Groups Links
          >
        • jamoville
          ... the ... I meant that you would have to detect the hide event and then do the clean up because you don t want to call destroy befor the cancel is done. ...
          Message 4 of 6 , Feb 28, 2007
          • 0 Attachment
            > I guess what your saying is that canceling a dialog does nothing
            > more than hiding it from the user. Clean up will only happen if
            the
            > cancel is detected and a call to destroy is done.

            I meant that you would have to detect the hide event and then do the
            clean up because you don't want to call destroy befor the cancel is
            done.

            --- In ydn-javascript@yahoogroups.com, "jamoville"
            <john.hutchinson@...> wrote:
            >
            > Ok - This may be a problem with my understanding of the use of
            > dialogs then. It's true that calling destroy on the panel
            instance
            > does result in a the subsequent calls to clean things up. I guess
            > what I was expecting was that a call to cancel the dialog should
            do
            > this for you and here is why I was thinking this. If I display a
            > dialog to the user and they hit the cancel or the x button to
            cancel
            > the dialog, the dialog goes away. If the destroy is not called
            > automatically at the time of the cancel then the cleanup never
            > happens and the memory is not cleaned up.
            >
            > I guess what your saying is that canceling a dialog does nothing
            > more than hiding it from the user. Clean up will only happen if
            the
            > cancel is detected and a call to destroy is done.
            >
            > Does this explanation explain what should be happening? If so - I
            > will subscribe to the cancel on all of my dialogs.
            >
            > Thanks again.
            >
            >
            > --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@>
            > wrote:
            > >
            > > "jamoville" -
            > >
            > > I just tested with version 2.2.0 of container.js and
            > calling "destroy" on a YAHOO.widget.Panel instance does result in
            a
            > call to both the "destroy" methods of YAHOO.widget.Overlay and
            > YAHOO.widget.Module as well as
            > YAHOO.widget.Panel.prototype.removeMask. Can you provide a URL to
            a
            > page that reproduces the leak so that I can take a look? If there
            > is in fact a memory leak caused by container.js I'd be more than
            > happy to help you fix it.
            > >
            > > Thanks,
            > > Todd
            > >
            > > ----- Original Message ----
            > > From: jamoville <john.hutchinson@>
            > > To: ydn-javascript@yahoogroups.com
            > > Sent: Wednesday, February 28, 2007 9:43:11 AM
            > > Subject: [ydn-javascript] Dialog mask not cleaning up memory leak
            > >
            > > I found a post that indicated a memory leak happens when a mask
            > was
            > > used with a dialog. I also found that there was a patch for
            this
            > > but I'm working with the latest code and I don't think this is
            > > working. In the container.js file there is a destroy : function
            ()
            > > for a Module that should be called by the
            > > YAHOO.widget.Overlay.superclass.destroy.call(this); method.
            This
            > > will fire the destroyEvent which will clean up the mask in the
            > > following method
            > > YAHOO.widget.Panel.prototype.removeMask
            > >
            > > None of this appears to ever happen. In order for this chain of
            > > events to happen the
            > > YAHOO.widget.Overlay.prototype.destroy
            > > method needs to be called but I don't see that ever happening.
            I
            > > even went so far as putting an alert box in these methods to
            make
            > > sure I wasn't missing the call but none of this is executing. I
            > see
            > > this as a big memory leak in my application. This seems like a
            > > pretty bad thing - any ideas on why this clean up code isn't
            > > happening?
            > >
            > > Thanks
            > >
            > >
            > >
            > >
            > > Yahoo! Groups Links
            > >
            >
          • Todd Kloots
            The following file demonstrates how to apply a patch that fixes the reported memory leaks for Dialog and Panel in IE:
            Message 5 of 6 , Mar 2, 2007
            • 0 Attachment
              The following file demonstrates how to apply a patch that fixes the reported memory leaks for Dialog and Panel in IE:



              http://yuiblog.com/sandbox/yui/v220/examples/container/example03.php



              - Todd


              ----- Original Message ----
              From: jamoville <john.hutchinson@...>
              To: ydn-javascript@yahoogroups.com
              Sent: Wednesday, February 28, 2007 9:43:11 AM
              Subject: [ydn-javascript] Dialog mask not cleaning up memory leak

              I found a post that indicated a memory leak happens when a mask was
              used with a dialog. I also found that there was a patch for this
              but I'm working with the latest code and I don't think this is
              working. In the container.js file there is a destroy : function()
              for a Module that should be called by the
              YAHOO.widget.Overlay.superclass.destroy.call(this); method. This
              will fire the destroyEvent which will clean up the mask in the
              following method
              YAHOO.widget.Panel.prototype.removeMask

              None of this appears to ever happen. In order for this chain of
              events to happen the
              YAHOO.widget.Overlay.prototype.destroy
              method needs to be called but I don't see that ever happening. I
              even went so far as putting an alert box in these methods to make
              sure I wasn't missing the call but none of this is executing. I see
              this as a big memory leak in my application. This seems like a
              pretty bad thing - any ideas on why this clean up code isn't
              happening?

              Thanks




              Yahoo! Groups Links
            • jamoville
              Like a charm - The fix works great. Thanks for the help ... see
              Message 6 of 6 , Mar 3, 2007
              • 0 Attachment
                Like a charm - The fix works great. Thanks for the help

                --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...> wrote:
                >
                > The following file demonstrates how to apply a patch that fixes the
                reported memory leaks for Dialog and Panel in IE:
                >
                >
                >
                > http://yuiblog.com/sandbox/yui/v220/examples/container/example03.php
                >
                >
                >
                > - Todd
                >
                >
                > ----- Original Message ----
                > From: jamoville <john.hutchinson@...>
                > To: ydn-javascript@yahoogroups.com
                > Sent: Wednesday, February 28, 2007 9:43:11 AM
                > Subject: [ydn-javascript] Dialog mask not cleaning up memory leak
                >
                > I found a post that indicated a memory leak happens when a mask was
                > used with a dialog. I also found that there was a patch for this
                > but I'm working with the latest code and I don't think this is
                > working. In the container.js file there is a destroy : function()
                > for a Module that should be called by the
                > YAHOO.widget.Overlay.superclass.destroy.call(this); method. This
                > will fire the destroyEvent which will clean up the mask in the
                > following method
                > YAHOO.widget.Panel.prototype.removeMask
                >
                > None of this appears to ever happen. In order for this chain of
                > events to happen the
                > YAHOO.widget.Overlay.prototype.destroy
                > method needs to be called but I don't see that ever happening. I
                > even went so far as putting an alert box in these methods to make
                > sure I wasn't missing the call but none of this is executing. I
                see
                > this as a big memory leak in my application. This seems like a
                > pretty bad thing - any ideas on why this clean up code isn't
                > happening?
                >
                > Thanks
                >
                >
                >
                >
                > Yahoo! Groups Links
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.