mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] app: sync destroy everythig when app is destroyed
Before this commit, the App destroy method would not destroy everything synchronously. The code scheduled a flush, which is asynchronous, to finally clean up the task lists, and destroy the cancelled nodes. But this is not really good for tests: we need a stronger guarantee that nothing will happen after the destroy. With this commit, we simply call the processTask method immediately after destroying the root component, so all cancelled nodes will be destroyed immediately.
This commit is contained in:
committed by
Sam Degueldre
parent
ca688d8640
commit
b1a3b322ee
+1
-1
@@ -136,8 +136,8 @@ export class App<
|
||||
|
||||
destroy() {
|
||||
if (this.root) {
|
||||
this.scheduler.flush();
|
||||
this.root.destroy();
|
||||
this.scheduler.processTasks();
|
||||
}
|
||||
window.__OWL_DEVTOOLS__.apps.delete(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user