summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/svdata.cxx8
-rw-r--r--vcl/source/app/svmain.cxx6
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;
}