summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/openerpframework.js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2013-10-11 11:54:24 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2013-10-11 11:54:24 +0200
commitcfcafee87cf8dc9e450c239d35512042e9670dd5 (patch)
treedbb0bc09aa21d43b5d36fbfb3f03ab447adb59e3 /addons/web/static/src/js/openerpframework.js
parent5050231a9c0d496a557e1bb28e122c0084469ea4 (diff)
[IMP] Added some documentation in the framwork.
bzr revid: nicolas.vanhoren@openerp.com-20131011095424-midppkv5czebt1f2
Diffstat (limited to 'addons/web/static/src/js/openerpframework.js')
-rw-r--r--addons/web/static/src/js/openerpframework.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js
index 027452b42fb..062ecb8fe80 100644
--- a/addons/web/static/src/js/openerpframework.js
+++ b/addons/web/static/src/js/openerpframework.js
@@ -138,6 +138,7 @@ var openerp = {};
throw new Error("You can only instanciate objects with the 'new' operator");
}
// All construction is actually done in the init method
+ this._super = null;
if (!initializing && this.init) {
var ret = this.init.apply(this, arguments);
if (ret) { return ret; }
@@ -385,6 +386,14 @@ var Events = openerp.Class.extend({
}
});
+/**
+ Mixin containing an event system. Events are also registered by specifying the target object
+ (the object which will receive the event when it is raised). Both the event-emitting object
+ and the target object store or reference to each other. This is used to correctly remove all
+ reference to the event handler when any of the object is destroyed (when the destroy() method
+ from ParentedMixin is called). Removing those references is necessary to avoid memory leak
+ and phantom events (events which are raised and sent to a previously destroyed object).
+*/
openerp.EventDispatcherMixin = _.extend({}, openerp.ParentedMixin, {
__eventDispatcherMixin: true,
init: function() {