From f8caa390332bd7554c49b071e2d7706b39dd62e1 Mon Sep 17 00:00:00 2001 From: suVene Date: Sun, 21 Dec 2008 17:06:19 +0000 Subject: * shutdown 時の timer cleanup. * document.unload 時の interval cleanup. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@27175 d0d07461-0603-4401-acd4-de1884942a52 --- notifier.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'notifier.js') diff --git a/notifier.js b/notifier.js index ea9bbf2..779d91d 100644 --- a/notifier.js +++ b/notifier.js @@ -5,7 +5,7 @@ var PLUGIN_INFO = change notice framework. 変更通知フレームワーク。 suVene - 0.1.3 + 0.1.4 2.0pre 2.0pre http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/notifier.js @@ -193,7 +193,8 @@ function bootstrap() { __initialize__: function(args) { $U.extend(this, args); if (typeof this.initialize == 'function') this.initialize(); - } + }, + shutdown: function() {} };//}}} var Subject = function() {//{{{ @@ -222,7 +223,8 @@ function bootstrap() { } }); }, - check: function() { throw 'needs override.' } + check: function() { throw 'needs override.' }, + shutdown: function() {} };//}}} var SubjectHttp = Subject;//{{{ @@ -323,6 +325,8 @@ function bootstrap() { this.subjects.getPlugins().forEach(function(s) s.attach(o)); })); + liberator.registerObserver("shutdown", $U.bind(this, function() this.stop())); + this.isBusy = false; },//}}} start: function() {//{{{ @@ -373,6 +377,8 @@ function bootstrap() { if (typeof finallycallback == 'function') finallycallback(); return; } + this.subjects.getPlugins().forEach(function(s) s.shutdown()); + this.observers.getPlugins().forEach(function(o) o.shutdown()); this.finallycallback = finallycallback; this.timer = false; }//}}} -- cgit v1.2.3