Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 5 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:


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.

Change History (5)

comment:1 Changed 9 years ago by flesler

  • Component changed from core to plugin
  • Keywords validate added
  • Owner set to joern

comment:2 Changed 9 years ago by joern

  • Component changed from plugin to core
  • Owner changed from joern to flesler

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

comment:3 Changed 9 years ago by joern

  • Summary changed from [validate] remove does not uncache validator to remove() does not remove associated data

comment:4 Changed 9 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 9 years ago by joern

  • Resolution set to invalid
  • Status changed from new to closed

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.