Skip to main content

Bug Tracker

Side navigation

#3078 closed bug (invalid)

Opened June 24, 2008 04:58AM UTC

Closed July 28, 2008 05:37PM UTC

Last modified March 14, 2012 08:59PM UTC

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 June 24, 2008 05:03AM UTC.

    a short script that demonstrates the caching issue

Change History (5)

Changed July 01, 2008 03:22AM UTC by flesler comment:1

component: coreplugin
keywords: → validate
owner: → joern

Changed July 13, 2008 12:50PM UTC by joern comment:2

component: plugincore
owner: joernflesler

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

Changed July 13, 2008 12:51PM UTC by joern comment:3

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

Changed July 13, 2008 05:57PM UTC by flesler comment:4

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).

Changed July 28, 2008 05:37PM UTC by joern comment:5

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.