File tree 3 files changed +9
-2
lines changed
pkg/analysis_server/lib/src
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ abstract class AnalysisServer {
138
138
139
139
late analysis.AnalysisDriverScheduler analysisDriverScheduler;
140
140
141
+ late StreamSubscription <Object ?>? analysisDriverSchedulerEventsSubscription;
142
+
141
143
DeclarationsTracker ? declarationsTracker;
142
144
143
145
/// The DiagnosticServer for this AnalysisServer. If available, it can be used
@@ -849,6 +851,9 @@ abstract class AnalysisServer {
849
851
850
852
@mustCallSuper
851
853
Future <void > shutdown () async {
854
+ await analysisDriverSchedulerEventsSubscription? .cancel ();
855
+ analysisDriverSchedulerEventsSubscription = null ;
856
+
852
857
// For now we record plugins only on shutdown. We might want to record them
853
858
// every time the set of plugins changes, in which case we'll need to listen
854
859
// to the `PluginManager.pluginsChanged` stream.
Original file line number Diff line number Diff line change @@ -406,7 +406,8 @@ class LegacyAnalysisServer extends AnalysisServer {
406
406
ServerContextManagerCallbacks (this , resourceProvider);
407
407
contextManager.callbacks = contextManagerCallbacks;
408
408
409
- analysisDriverScheduler.events.listen (handleAnalysisEvent);
409
+ analysisDriverSchedulerEventsSubscription =
410
+ analysisDriverScheduler.events.listen (handleAnalysisEvent);
410
411
analysisDriverScheduler.start ();
411
412
412
413
onAnalysisStarted.first.then ((_) {
Original file line number Diff line number Diff line change @@ -178,7 +178,8 @@ class LspAnalysisServer extends AnalysisServer {
178
178
LspServerContextManagerCallbacks (this , resourceProvider);
179
179
contextManager.callbacks = contextManagerCallbacks;
180
180
181
- analysisDriverScheduler.events.listen (handleAnalysisEvent);
181
+ analysisDriverSchedulerEventsSubscription =
182
+ analysisDriverScheduler.events.listen (handleAnalysisEvent);
182
183
analysisDriverScheduler.start ();
183
184
184
185
_channelSubscription =
You can’t perform that action at this time.
0 commit comments