fixed crash with OpenGL view