[host] nvfbc: disable pointerThread when unused

fixes log spam that would occur when decoupleCursor=false
This commit is contained in:
arcnmx 2021-07-25 22:14:10 -07:00 committed by Geoffrey McRae
parent 03ed8b7304
commit c0aec7d8f4

View File

@ -239,7 +239,7 @@ static bool nvfbc_init(void)
Sleep(100); Sleep(100);
if (!lgCreateThread("NvFBCPointer", pointerThread, NULL, &this->pointerThread)) if (this->seperateCursor && !lgCreateThread("NvFBCPointer", pointerThread, NULL, &this->pointerThread))
{ {
DEBUG_ERROR("Failed to create the NvFBCPointer thread"); DEBUG_ERROR("Failed to create the NvFBCPointer thread");
nvfbc_deinit(); nvfbc_deinit();
@ -254,12 +254,15 @@ static void nvfbc_stop(void)
{ {
this->stop = true; this->stop = true;
lgSignalEvent(this->cursorEvent); if (this->seperateCursor)
if (this->pointerThread)
{ {
lgJoinThread(this->pointerThread, NULL); lgSignalEvent(this->cursorEvent);
this->pointerThread = NULL;
if (this->pointerThread)
{
lgJoinThread(this->pointerThread, NULL);
this->pointerThread = NULL;
}
} }
} }