summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/static/src/js/core')
-rw-r--r--addons/web/static/src/js/core/mixins.js4
-rw-r--r--addons/web/static/src/js/core/widget.js5
2 files changed, 3 insertions, 6 deletions
diff --git a/addons/web/static/src/js/core/mixins.js b/addons/web/static/src/js/core/mixins.js
index 228ac2d68dd..06f39e0fcfe 100644
--- a/addons/web/static/src/js/core/mixins.js
+++ b/addons/web/static/src/js/core/mixins.js
@@ -98,8 +98,8 @@ var ParentedMixin = {
* resource it could have reserved.
*/
destroy : function () {
- _.each(this.getChildren(), function (el) {
- el.destroy();
+ this.getChildren().forEach(function (child) {
+ child.destroy();
});
this.setParent(undefined);
this.__parentedDestroyed = true;
diff --git a/addons/web/static/src/js/core/widget.js b/addons/web/static/src/js/core/widget.js
index 0de8c6aa1cd..441899e30db 100644
--- a/addons/web/static/src/js/core/widget.js
+++ b/addons/web/static/src/js/core/widget.js
@@ -172,13 +172,10 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, {
* destroying itself.
*/
destroy: function () {
- this.getChildren().forEach(function (child) {
- child.destroy();
- });
+ mixins.PropertiesMixin.destroy.call(this);
if (this.$el) {
this.$el.remove();
}
- mixins.PropertiesMixin.destroy.call(this);
},
//--------------------------------------------------------------------------