diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-02-12 21:54:42 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-02-13 00:25:05 +0100 |
commit | cd24d2524f2c2da51f982015f1b027003b192808 (patch) | |
tree | 1bafe71bbb1c7ead42b39721398f45cb98e2c8d8 /extensions | |
parent | 43cb934dda9af45a83748c775f274bbd0fdcd67a (diff) |
extensions: plugin: UNX: don't crash headless
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/plugin/base/xplugin.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index b604b211e379..261b4e6507a3 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -523,7 +523,10 @@ void XPlugin_Impl::loadPlugin() } const SystemEnvData* pEnvData = getSysChildSysData(); #if defined( UNX ) && !(defined(QUARTZ)) - XSync( (Display*)pEnvData->pDisplay, False ); + if (pEnvData->pDisplay) // headless? + { + XSync( (Display*)pEnvData->pDisplay, False ); + } #endif if( ! getPluginComm() ) { @@ -568,8 +571,15 @@ void XPlugin_Impl::loadPlugin() // m_aNPWindow is set up in the MacPluginComm from the view SetSysPlugDataParentView(*pEnvData); #elif defined( UNX ) - XSync( (Display*)pEnvData->pDisplay, False ); - m_aNPWindow.window = (void*)pEnvData->aWindow; + if (pEnvData->pDisplay) // headless? + { + XSync( (Display*)pEnvData->pDisplay, False ); + m_aNPWindow.window = (void*)pEnvData->aWindow; + } + else + { + m_aNPWindow.window = NULL; + } m_aNPWindow.ws_info = NULL; #else m_aNPWindow.window = (void*)pEnvData->hWnd; |