Opened 8 years ago

Closed 7 years ago

#5118 closed bug (notabug)

this.options never deleted

Reported by: schaef Owned by: schaef
Priority: major Milestone: 1.9.0
Component: ui.widget Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

If you store some data in your widget with this._setData('test', largeJson); and than remove your widget from DOM, the largeJson will not be removed by the default destroy method. It stays until a page refresh in the memory.

If I add the line delete this.options; in the default destroy method in ui.core.js the 'real' object is removed from memory. It seems to me that jQuery.cache.id.widgetname.options.test is only a reference to the place of the object 'largeJson'. And that only the reference is deleted by default, not the value itself.

Change History (5)

comment:1 Changed 8 years ago by Scott González

Component: ui.coreui.widget

comment:2 Changed 7 years ago by Jörn Zaefferer

Are you suggesting to add delete this.options in the destroy methods?

I wonder if a proper GC shouldn't clean this up once there is no reference left to the widget instance. Maybe a instance reference still exists and we should actually clean that up.

comment:3 Changed 7 years ago by Scott González

The _setData method no longer exists. Can you check whether this problem still exists in the most recent version?

comment:4 Changed 7 years ago by Scott González

Owner: set to schaef
Status: newpending

This sounds like you're keeping a reference to the data yourself somewhere else.

comment:5 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.