Skip to content

Fix crash when re-initializing Sentry#594

Merged
tustanivsky merged 3 commits intomainfrom
fix/subsystem-reinit
Jul 9, 2024
Merged

Fix crash when re-initializing Sentry#594
tustanivsky merged 3 commits intomainfrom
fix/subsystem-reinit

Conversation

@tustanivsky
Copy link
Copy Markdown
Collaborator

This PR fixes the internal plugin crash when re-initializing USentrySubsystem without its explicit closing beforehand.

The crash was related to custom Sentry output devices that were not deregistered properly upon any subsequent initialization attempt.

Also, assertion/ensure delegates are now deregistered too whenever calling subsystem's Close method to avoid potential reporting of the same event multiple times if re-init occured.

Closes #592

Comment on lines +181 to +184
if(OnEnsureDelegate.IsValid())
{
FCoreDelegates::OnHandleSystemEnsure.Remove(OnEnsureDelegate);
OnEnsureDelegate.Reset();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this go into the closure above as well?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in order to capture ensures we don't use any of our custom output devices but rather rely on the engine's FCoreDelegates::OnHandleSystemEnsure delegate.

Copy link
Copy Markdown
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tustanivsky tustanivsky merged commit 1704e0f into main Jul 9, 2024
@tustanivsky tustanivsky deleted the fix/subsystem-reinit branch July 9, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when re-initializing the sentry subsystem

2 participants