Workaround for ugly OpenGL warning in multi-threaded environment