I’ve noticed some memory leaks in an app i’m building, after playing around with for a while FF will start to use up more and more memory (upwards to 1 000 000 k).
I’ve done some research and found that if i do a $(selector).html(some stuff) to replace the contents of something the jQuery handlers from the elements previous content will not be removed and cause some problems, i’ve fixed all those.
the question i have is if i destroy a dialog with $(mydialog).dialog('destroy'); will the handlers that were attached to various elements that were in that dialog be removed?
Thanks!
No, they will not be removed, the dialog element itself will be returned to it’s previous state, the elements inside aren’t touched.
The dialog widget itself, the buttons, title bar, close button, etc. are cleaned up, but the element you turned into a dialog is not affected and not cleaned up. You need to either
.empty()or.remove()the whole element for that.