mw.ViewPageTarget: Explicitly release our copy of linmod data

Follows-up Ic0c6d190c9b78 which introduced a full linmod copy in a
scope that is also accessible by other closures (namely the
callbacks to jQuery.Deferred #done and #always, and setTimeout).

Though in theory engines may be able to garbage collect it,
I doubt it. Though browsers probably destruct the setTimeout
callback I know  at least the closures pass to jQuery.Deferred
are not released by jQuery, so an engine would have to
understand these other functions well enough to know it doesn't
access the `data` variable.

Let's release explicitly to be safe.

Change-Id: I11000edcad4690dcce53b6e9d1a45bf2ab82fbcb
This commit is contained in:
Timo Tijhof 2013-07-10 02:17:02 +02:00 committed by Catrope
parent 2e0f80e0d3
commit 50b7a9fc93

View file

@ -936,6 +936,9 @@ ve.init.mw.ViewPageTarget.prototype.startSanityCheck = function () {
len = oldDom.body.childNodes.length,
newDom = ve.dm.converter.getDomFromData( data, doc.getStore(), doc.getInternalList() );
// Explicitly unlink our full copy of the original version of the document data
data = undefined;
if ( len !== newDom.body.childNodes.length ) {
// Different number of children, so they're definitely different
d.reject();