Prevent crash when doing threaded rendering of multiple windows.