Forward low memory notifications from the shell to DartVM. (flutter/engine#14517)

This commit is contained in:
Chinmay Garde
2019-12-16 16:55:08 -08:00
committed by GitHub
parent 2dc224f3fe
commit 54f9ebe7a9

View File

@@ -393,6 +393,12 @@ Shell::~Shell() {
}
void Shell::NotifyLowMemoryWarning() const {
// This does not require a current isolate but does require a running VM.
// Since a valid shell will not be returned to the embedder without a valid
// DartVMRef, we can be certain that this is a safe spot to assume a VM is
// running.
::Dart_NotifyLowMemory();
task_runners_.GetGPUTaskRunner()->PostTask(
[rasterizer = rasterizer_->GetWeakPtr()]() {
if (rasterizer) {