Disconnect surface model history listener when tearing down

Bug: T195775
Change-Id: I6f6fe654dc190d7d891d3ac346bf3f4b2f426947
This commit is contained in:
Ed Sanders 2018-05-28 15:38:49 +01:00 committed by Bartosz Dziewoński
parent 54f9335232
commit 4f456b143e

View file

@ -1948,6 +1948,8 @@ ve.init.mw.ArticleTarget.prototype.teardown = function () {
if ( surface ) { if ( surface ) {
// If target is closed cleanly (after save or deliberate close) then remove autosave state // If target is closed cleanly (after save or deliberate close) then remove autosave state
surface.getModel().removeDocStateAndChanges(); surface.getModel().removeDocStateAndChanges();
// Disconnect history listener
surface.getModel().disconnect( this );
} }
return ve.init.mw.ArticleTarget.super.prototype.teardown.call( this ); return ve.init.mw.ArticleTarget.super.prototype.teardown.call( this );
}; };