- wxGLContext *share= win->m_sharedContext;
- if (share==NULL && win->m_sharedContextOf) share=win->m_sharedContextOf->GetContext();
+ // VZ: apparently in some cases we're called twice -- no idea why,
+ // but a check doesn't hurt
+ if ( !win->m_glContext )
+ {
+ wxGLContext *share = win->m_sharedContext;
+ if ( !share && win->m_sharedContextOf )
+ share = win->m_sharedContextOf->GetContext();