Prevent crash on program close (null stream fix) (#838)

* Fix Access Violation

* Fix AccessViolation
This commit is contained in:
McSchneidar authored and GitHub committed 2026-02-22 18:57:23 +01:00
1 parent ff26565143
commit 8c48e37c4f
1 file changed
+6 -1
+6 -1
View File
@@ -176,6 +176,11 @@ namespace Vocaluxe.Lib.Sound
try try
{ {
if (stream == IntPtr.Zero)
{
CLog.Debug("Stream is null, skipping close.");
return;
}
PortAudio.Pa_CloseStream(stream); PortAudio.Pa_CloseStream(stream);
} }
catch (Exception ex) catch (Exception ex)
@@ -235,4 +240,4 @@ namespace Vocaluxe.Lib.Sound
return selectedHostApi; return selectedHostApi;
} }
} }
} }