diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-12-02 10:29:00 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-12-03 14:05:35 +0100 |
commit | db172a460894f9bfad27eacf9ec69235358bcf6c (patch) | |
tree | 5d409c59885e4c6aa5c9947bbce7da2137e4c217 | |
parent | 53193345e049be67415569415e19588b33c8cecd (diff) |
vcl: Add reference on default window's context so it doesn't get destroyed
Change-Id: Ifce8903ce75b1d2ff6acfd717c689f8893d80802
-rw-r--r-- | vcl/source/app/svdata.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index dea142959463..59b2d23cd2bc 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -39,6 +39,7 @@ #include "vcl/dockwin.hxx" #include "salinst.hxx" #include "salframe.hxx" +#include "salgdi.hxx" #include "svdata.hxx" #include "window.h" #include "salimestatus.hxx" @@ -49,6 +50,8 @@ #include "officecfg/Office/Common.hxx" +#include "vcl/opengl/OpenGLContext.hxx" + #include <stdio.h> using namespace com::sun::star::uno; @@ -129,6 +132,11 @@ vcl::Window* ImplGetDefaultWindow() DBG_WARNING( "ImplGetDefaultWindow(): No AppWindow" ); pSVData->mpDefaultWin = new WorkWindow( 0, WB_DEFAULTWIN ); pSVData->mpDefaultWin->SetText( OUString( "VCL ImplGetDefaultWindow" ) ); + + // Add a reference to the default context so it never gets deleted + OpenGLContext* pContext = pSVData->mpDefaultWin->GetGraphics()->GetOpenGLContext(); + if( pContext ) + pContext->AddRef(); } Application::GetSolarMutex().release(); } diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index c43fc578f33b..c1456ad8d46d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -65,12 +65,15 @@ #include "outfont.hxx" #include "PhysicalFontCollection.hxx" #include "print.h" +#include "salgdi.hxx" #include "salsys.hxx" #include "saltimer.hxx" #include "salimestatus.hxx" #include "impimagetree.hxx" #include "xconnection.hxx" +#include "vcl/opengl/OpenGLContext.hxx" + #include "osl/process.h" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/lang/XComponent.hpp" @@ -442,6 +445,9 @@ void DeInitVCL() } if ( pSVData->mpDefaultWin ) { + OpenGLContext* pContext = pSVData->mpDefaultWin->GetGraphics()->GetOpenGLContext(); + if( pContext ) + pContext->DeRef(); delete pSVData->mpDefaultWin; pSVData->mpDefaultWin = NULL; } |