Skip to content

fix: check MainHandle for null before starting MainEventLoop thread - #790

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/init-null-check-before-thread
Open

fix: check MainHandle for null before starting MainEventLoop thread#790
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/init-null-check-before-thread

Conversation

@Noethix55555

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant