CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
228 stars 89 forks source link

399-the-main-menu-music-track-can-be-heard-after-the-client-closes #440

Closed Rans4ckeR closed 1 year ago

Rans4ckeR commented 1 year ago

Fixes #399 Also fixes the 2nd stage updater unable to update the music file on linux as it complains about the file still being in use even after the client has exited.

github-actions[bot] commented 1 year ago

Nightly build for this pull request:

Rampastring commented 1 year ago

There should be a MediaPlayer.Stop() call to stop music playback before the track is disposed. I'd expect just disposing the song while it's playing might lead into an exception.

EDIT: Oh nvm, I can see it's called in FadeMusicExit. Wonder why that doesn't work...

When updating it makes sense because the updater just calls ExitClient directly. Could add the MediaPlayer.Stop call to the ExitClient method before disposing the track.