Cleanup branch work
This commit is contained in:
@@ -51,12 +51,9 @@ namespace Bootstrap
|
||||
|
||||
// Subscribe to loading screen completion event
|
||||
initialLoadingScreen.OnLoadingScreenFullyHidden += OnInitialLoadingComplete;
|
||||
RegisterManagedEvent(initialLoadingScreen, nameof(initialLoadingScreen.OnLoadingScreenFullyHidden),
|
||||
(Action)OnInitialLoadingComplete);
|
||||
|
||||
// Subscribe to boot progress for real-time updates during bootstrap
|
||||
CustomBoot.OnBootProgressChanged += OnBootProgressChanged;
|
||||
// Note: Static events need manual cleanup in OnDestroy
|
||||
|
||||
_logVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().bootstrapLogVerbosity;
|
||||
|
||||
@@ -83,10 +80,14 @@ namespace Bootstrap
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
// Manual cleanup for static event (RegisterManagedEvent doesn't handle static events properly)
|
||||
CustomBoot.OnBootProgressChanged -= OnBootProgressChanged;
|
||||
base.OnDestroy();
|
||||
|
||||
base.OnDestroy(); // Handles other managed event cleanup
|
||||
// Manual cleanup for events
|
||||
if (initialLoadingScreen != null)
|
||||
{
|
||||
initialLoadingScreen.OnLoadingScreenFullyHidden -= OnInitialLoadingComplete;
|
||||
}
|
||||
CustomBoot.OnBootProgressChanged -= OnBootProgressChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user