qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] dsound and crash (2)


From: ZIGLIO, Frediano, VF-IT
Subject: [Qemu-devel] dsound and crash (2)
Date: Mon, 5 Jun 2006 10:16:40 +0200

Well,
   to sum up the problem with dsound (Windows audio driver), qemu crash
when is closed using "X" in console window. The reason is quite
complicated:
- in audio/dsoundaudio.c you allocate a IDirectSound* using
CoCreateInstance
- in audio/audio.c AUD_init you set up a atexit handler
- you close console window with X
- windows start to cleanup DLLs
  - dsound depend on msvcrt so it clean dsound before msvcrt
  - dsound free allocate resources
  - msvcrt is cleaned, is calls atexit functions
  - audio.c audio_atexit calls dsoundaudio.c dsound_audio_fini witch
should call dsound functions to free structures however dsound.dll is
not loaded and memory is already freed by dsound... so qemu crash.

I proposed a workaround to call SetConsoleCtrlHandler in main to catch
console close before dll unload. Another solution would be to not
deallocate dsound in dsound_audio_fini but I think that
SetConsoleCtrlHandler solution is cleaner and better. I don't understand
why ctrl-c do not cause a crash...

freddy77





reply via email to

[Prev in Thread] Current Thread [Next in Thread]