Commit 5da7c7a7 authored by Tobias Doerffel's avatar Tobias Doerffel Committed by Christian Beier

Added missing initialization of extension mutex

When not calling rfbRegisterProtocolExtension() the extension mutex
is uninitialized but used upon calling rfbGetExtensionIterator() and
rfbReleaseExtensionIterator() in rfbNewTCPOrUDPClient(). This causes
libvncserver to crash on Win32 when building with thread support.
Signed-off-by: 's avatarTobias Doerffel <tobias.doerffel@gmail.com>
Signed-off-by: 's avatarChristian Beier <dontmind@freeshell.org>
parent 128d06aa
......@@ -145,6 +145,11 @@ rfbUnregisterProtocolExtension(rfbProtocolExtension* extension)
rfbProtocolExtension* rfbGetExtensionIterator()
{
if (! extMutex_initialized) {
INIT_MUTEX(extMutex);
extMutex_initialized = 1;
}
LOCK(extMutex);
return rfbExtensionHead;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment