@@ -46,12 +46,6 @@ class SentryClient {
4646
4747 static final _emptySentryId = Future .value (SentryId .empty ());
4848
49- late final SdkLifecycleRegistry _lifecycleRegistry;
50-
51- /// Allows registration and dispatching of callbacks outside of SentryClient
52- @internal
53- SdkLifecycleRegistry get lifeCycleRegistry => _lifecycleRegistry;
54-
5549 SentryExceptionFactory get _exceptionFactory => _options.exceptionFactory;
5650 SentryStackTraceFactory get _stackTraceFactory => _options.stackTraceFactory;
5751
@@ -89,9 +83,7 @@ class SentryClient {
8983
9084 /// Instantiates a client using [SentryOptions]
9185 SentryClient ._(this ._options)
92- : _random = _options.sampleRate == null ? null : Random () {
93- _lifecycleRegistry = SdkLifecycleRegistry (_options);
94- }
86+ : _random = _options.sampleRate == null ? null : Random ();
9587
9688 /// Reports an [event] to Sentry.io.
9789 Future <SentryId > captureEvent (
@@ -172,7 +164,7 @@ class SentryClient {
172164 }
173165
174166 // Event is fully processed and ready to be sent
175- await _lifecycleRegistry
167+ await _options.lifecycleRegistry
176168 .dispatchCallback (OnBeforeSendEvent (preparedEvent, hint));
177169
178170 var attachments = List <SentryAttachment >.from (scope? .attachments ?? []);
@@ -579,7 +571,7 @@ class SentryClient {
579571 }
580572
581573 if (processedLog != null ) {
582- await _lifecycleRegistry
574+ await _options.lifecycleRegistry
583575 .dispatchCallback (OnBeforeCaptureLog (processedLog));
584576 _options.logBatcher.addLog (processedLog);
585577 } else {
0 commit comments