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: Tobias Doerffel <tobias.doerffel@gmail.com>
Signed-off-by: Christian Beier <dontmind@freeshell.org>
pull/1/head
Tobias Doerffel 12 years ago committed by Christian Beier
parent 128d06aaaa
commit 5da7c7a71a

@ -145,6 +145,11 @@ rfbUnregisterProtocolExtension(rfbProtocolExtension* extension)
rfbProtocolExtension* rfbGetExtensionIterator()
{
if (! extMutex_initialized) {
INIT_MUTEX(extMutex);
extMutex_initialized = 1;
}
LOCK(extMutex);
return rfbExtensionHead;
}

Loading…
Cancel
Save