Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ class CodeViewController extends DisposableController
);

if (succeeded) {
// The controller may have been disposed while awaiting the asynchronous
// location display setup.
if (disposed) return;
Comment thread
srawlins marked this conversation as resolved.
// Update the scripts history (and make sure we don't react to the
// subsequent event).
scriptsHistory.current.removeListener(_scriptHistoryListener);
Expand All @@ -234,6 +237,8 @@ class CodeViewController extends DisposableController
final isolateRef =
serviceConnection.serviceManager.isolateManager.selectedIsolate.value!;
final processedReport = await _getSourceReport(isolateRef, current.script);
// The controller may have been disposed while awaiting the source report.
if (disposed) return;

parsedScript.value = ParsedScript(
script: current.script,
Expand Down Expand Up @@ -264,6 +269,8 @@ class CodeViewController extends DisposableController
if (scriptRef.id != parsedScript.value?.script.id) {
// Try to parse the script if it isn't the currently parsed script:
final script = await _parseScript(scriptRef);
// The controller may have been disposed while awaiting the script parsing.
if (disposed) return false;
if (script == null) {
// Return early and indicate failure if parsing fails.
reportError(
Expand Down
Loading