[dart-runner] Avoid calling Destroy on nullptr (flutter/engine#23608)
This commit is contained in:
@@ -440,7 +440,11 @@ bool DartComponentController::Main() {
|
||||
|
||||
void DartComponentController::Kill() {
|
||||
if (Dart_CurrentIsolate()) {
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy();
|
||||
tonic::DartMicrotaskQueue* queue =
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread();
|
||||
if (queue) {
|
||||
queue->Destroy();
|
||||
}
|
||||
|
||||
loop_->Quit();
|
||||
|
||||
|
||||
@@ -83,7 +83,12 @@ void IsolateShutdownCallback(void* isolate_group_data, void* isolate_data) {
|
||||
auto dispatcher = async_get_default_dispatcher();
|
||||
auto loop = async_loop_from_dispatcher(dispatcher);
|
||||
if (loop) {
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy();
|
||||
tonic::DartMicrotaskQueue* queue =
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread();
|
||||
if (queue) {
|
||||
queue->Destroy();
|
||||
}
|
||||
|
||||
async_loop_quit(loop);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user