ValveSoftware / wine

Wine with a bit of extra spice
Other
1.3k stars 244 forks source link

MMDevAPI: IAudioSessionEnumerator returns nonsense session count and leaks memory #260

Open Kaldaien opened 1 month ago

Kaldaien commented 1 month ago

Changes introduced in Add implementation for IAudioSessionEnumerator are preventing Special K from working.

The previous stub implementation was fine, but with the introduction of the session enumerator, Special K cannot be used in any game without leaking memory and quickly crashing (unless I activate a Wine-specific workaround added in Special K 24.10.19).

Here is the implementation of Special K's session enumeration if it helps. This works just fine on Windows with no leaks or the crazy number of sessions returned by IAudioSessionEnumerator::GetCount (...).


While reviewing the changes above, I noticed a problem with the Critical Section guarding the session list.

Critical Section guarding audio sessions is entered twice, never exited. 2762b7a

I think the second sessions_lock () should be sessions_unlock ()