summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/core/domain_tests.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2017-04-07 10:28:59 +0200
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commitb6ce7b136f561f156fb9ed1cc8694da86aff466e (patch)
treecc484e0920084d7cdceb305ea6e37394dbe5111e /addons/web/static/tests/core/domain_tests.js
parentec9001eb9de0c1cc42b538616b74cf2befd82322 (diff)
[IMP] web: protect _rpc calls on destroyed widgets
It might happen that some code in a widget (callbacks given to other function calls) is executed after the widget's destruction. For example, trigger an event up with a callback in option, the event is handled by a parent that performs an rpc, meanwhile, the child widget is destroyed, then, the rpc returns and the parent executes the callback. This shouldn't happen, because it means that the callback is executed for nothing. Worst, it crashes if the function _rpc is called inside the callback, because the widget being destroyed, there is no parent to handle the request, and _rpc thus returns undefined. This rev. protects the code from crashing by making _rpc return a pending deferred instead of undefined.
Diffstat (limited to 'addons/web/static/tests/core/domain_tests.js')
0 files changed, 0 insertions, 0 deletions