Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#3078 closed bug (invalid)

remove() does not remove associated data

Reported by: jeberma Owned by: flesler
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: validate Cc:
Blocked by: Blocking:

Description

Removing a validated form element with $('#myForm').remove() does not free the jQuery.cache of the validator instance. Using this chain, $('#myForm').remove().removeData(), does free the cache, however. Please see the attached code.

Attachments (1)

issue3078.html (2.1 KB) - added by jeberma 10 years ago.
a short script that demonstrates the caching issue

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by jeberma

Attachment: issue3078.html added

a short script that demonstrates the caching issue

comment:1 Changed 10 years ago by flesler

Component: coreplugin
Keywords: validate added
Owner: set to joern

comment:2 Changed 10 years ago by joern

Component: plugincore
Owner: changed from joern to flesler

Not plugin related. Maybe remove() should also clean up data via removeData().

comment:3 Changed 10 years ago by joern

Summary: [validate] remove does not uncache validatorremove() does not remove associated data

comment:4 Changed 10 years ago by flesler

The stored data doesn't cause memory leaks per se. Only event handlers. That's the reason it's not cleaned up on remove().

Why should it be removed ? not that this means a big slow down for each removed node (and its descendants).

comment:5 Changed 10 years ago by joern

Resolution: invalid
Status: newclosed

Considering that the validator instance is stored just in the cache and nowhere else, there isn't a problem the issue of memory leaks. Therefore the overhead of removing data while removing nodes and its descendants isn't worth it.

Please reopen the ticket if you have a scenario where the stale cache actually poses a problem.

Note: See TracTickets for help on using tickets.