Skip to content

Prevent intermittent crash when closing OvEditor#736

Merged
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:731
Apr 18, 2026
Merged

Prevent intermittent crash when closing OvEditor#736
adriengivry merged 2 commits into
Overload-Technologies:mainfrom
Gopmyc:731

Conversation

@Gopmyc

@Gopmyc Gopmyc commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an intermittent crash when closing OvEditor by making AudioEngine properly unsubscribe from static audio entity events during shutdown.

Root cause:

  • AudioEngine subscribed to static AudioSource / AudioListener events but never removed those listeners.
  • During teardown, stale callbacks could target a destroyed AudioEngine, causing undefined behavior/crash.

What changed:

  • Stored listener IDs for:
    • AudioSource::CreatedEvent
    • AudioSource::DestroyedEvent
    • AudioListener::CreatedEvent
    • AudioListener::DestroyedEvent
  • Explicitly removed those listeners in AudioEngine destructor before backend deinit.

Scope:

  • Minimal and local changes only in OvAudio/Core/AudioEngine.*.
  • No API change, no behavior change outside shutdown safety.

Related Issue(s)

Fixes #731

Review Guidance

Please review destruction/lifecycle order in AudioEngine:

  • Event subscriptions are now tracked by ID.
  • Event unsubscriptions happen in ~AudioEngine() before m_backend->deinit().

Files changed:

  • Sources/OvAudio/include/OvAudio/Core/AudioEngine.h
  • Sources/OvAudio/src/OvAudio/Core/AudioEngine.cpp

Screenshots/GIFs

N/A (no UI change)

Checklist

  • My code follows the project's code style guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes don't generate new warnings or errors

@adriengivry adriengivry merged commit c3aad7f into Overload-Technologies:main Apr 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Crash when closing OvEditor

2 participants