Add call to Dart_NotifyDestroyed when the flutter view is destroyed.#37539
Add call to Dart_NotifyDestroyed when the flutter view is destroyed.#37539a-siva merged 5 commits intoflutter:mainfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
FYI @dnfield |
shell/common/shell.cc
Outdated
| if (engine) { | ||
| engine->NotifyDestroyed(); | ||
| } | ||
| }; |
There was a problem hiding this comment.
It looks like this task never gets run?
There was a problem hiding this comment.
Fixed the code to ensure the task gets run.
|
|
||
| tonic::DartState::Scope scope(root_isolate); | ||
|
|
||
| Dart_NotifyDestroyed(); |
|
I think this looks right but would appreciate a pass from @jason-simmons to double check any threading considerations. |
| @pragma('vm:external-name', 'NotifyNativeBool') | ||
| external void notifyNativeBool(bool value); | ||
| @pragma('vm:external-name', 'NotifyDestroyedBool') | ||
| external void notifyDestroyedBool(); |
shell/common/shell.cc
Outdated
| // https://github.com/flutter/flutter/issues/96679 is fixed. | ||
| rasterizer_->TeardownExternalViewEmbedder(); | ||
|
|
||
| task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { |
There was a problem hiding this comment.
Would it be safe to move this to the start of Shell::OnPlatformViewDestroyed so it can run concurrently with the IO and raster thread tasks in that method?
* ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…5592) * ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
…5592) * ac874d6 [Multiwindow] Renderers receive view IDs as argument (flutter/engine#36593) * bc86c1f Roll Skia from d90917a1da6b to 89f8ba6f749d (10 revisions) (flutter/engine#37723) * dd12a40 delete fontface polyfill (flutter/engine#37652) * 1e1a4ab Add call to Dart_NotifyDestroyed when the flutter view is destroyed. (flutter/engine#37539)
Add call to Dart_NotifyDestroyed when the flutter view is destroyed.