- /* Most Carbon APIs are not thread-safe, therefore delagate some GUI visibilty update to the main thread */
- sendEventToMainThread(GetWindowEventTarget(p_vout->p_sys->theWindow), kEventClassVLCPlugin, kEventVLCPluginHideFullscreen);
+ if( p_vout->p_sys->theWindow )
+ {
+ /* Most Carbon APIs are not thread-safe, therefore delagate some GUI visibilty
+ * update to the main thread */
+ sendEventToMainThread(GetWindowEventTarget(p_vout->p_sys->theWindow),
+ kEventClassVLCPlugin, kEventVLCPluginHideFullscreen);
+ }