summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-12-02 10:29:00 -0500
committerJan Holesovsky <kendy@collabora.com>2014-12-03 14:41:18 +0100
commit966fb80512545d2bdfb3afdb247ee3b9d111aa23 (patch)
tree5af166853773ca277ae1258b79c409e58d694b1a
parent1f81123d8cb42fe1ba4d7f5922474fdabb171d1d (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.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 0aaff4a14e05..1485305166ee 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;
@@ -132,6 +135,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 bd3544bc125a..2fc122c35d56 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"
@@ -448,6 +451,9 @@ void DeInitVCL()
}
if ( pSVData->mpDefaultWin )
{
+ OpenGLContext* pContext = pSVData->mpDefaultWin->GetGraphics()->GetOpenGLContext();
+ if( pContext )
+ pContext->DeRef();
delete pSVData->mpDefaultWin;
pSVData->mpDefaultWin = NULL;
}