Skip to content

Commit 6849630

Browse files
committed
Refactor LdClient cleanup logic to ensure proper disposal order of resources
1 parent f4a903b commit 6849630

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkgs/sdk/client/src/LdClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,13 +982,13 @@ void Dispose(bool disposing)
982982
_dataSourceUpdateSink.UpdateStatus(DataSourceState.Shutdown, null);
983983

984984
_backgroundModeManager.BackgroundModeChanged -= OnBackgroundModeChanged;
985-
_connectionManager.Dispose();
986-
_dataStore.Dispose();
987-
_eventProcessor.Dispose();
988985
foreach (var hook in _pluginHooks)
989986
{
990987
hook?.Dispose();
991988
}
989+
_connectionManager.Dispose();
990+
_dataStore.Dispose();
991+
_eventProcessor.Dispose();
992992

993993
// Reset the static Instance to null *if* it was referring to this instance
994994
DetachInstance();

0 commit comments

Comments
 (0)