mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:09:48 +00:00
Make _cancelWakeup a no-op if _sendPort is null
This seems to fix the issue, but it's a flaky crash so it's hard to 100% verify. Bug: https://github.com/dart-lang/sdk/issues/33838 Bug: https://github.com/flutter/devtools/issues/337 Change-Id: Ic037a94cfb9fe7da319d7d4b20e3a3efd0c7289f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97541 Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Liam Appelbe <liama@google.com>
This commit is contained in:
parent
8f827aef4f
commit
9622562482
|
@ -430,9 +430,10 @@ class _Timer implements Timer {
|
|||
|
||||
// Cancel pending wakeups in the event handler.
|
||||
static void _cancelWakeup() {
|
||||
assert(_sendPort != null);
|
||||
VMLibraryHooks.eventHandlerSendData(null, _sendPort, _NO_TIMER);
|
||||
_scheduledWakeupTime = null;
|
||||
if (_sendPort != null) {
|
||||
VMLibraryHooks.eventHandlerSendData(null, _sendPort, _NO_TIMER);
|
||||
_scheduledWakeupTime = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Create a receive port and register a message handler for the timer
|
||||
|
|
Loading…
Reference in a new issue