mpv.net icon indicating copy to clipboard operation
mpv.net copied to clipboard

fix: check MainHandle for null before starting MainEventLoop thread

Open Bolt4243 opened this issue 5 months ago • 0 comments

Init started the MainEventLoop background thread before checking whether mpv_create() returned a non-null handle. If mpv_create fails the thread is already running and calls mpv_wait_event(IntPtr.Zero, -1), which is undefined behavior.

Moved the null-check to immediately after mpv_create(), before any thread is started or any mpv API is called.

Bolt4243 avatar Jun 18 '26 02:06 Bolt4243