From 2456cf8306be22e32130e789ab939c059e5e79e5 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 7 Sep 2015 22:21:15 +0100 Subject: tdf#94006 - re-factor to use rtl::Reference for OpenGLContexts. Don't use rtl::Reference for the global / list state, so the ref-count reflects the number of real users. Hold a reference during ~OpenGLContext. Change-Id: I4e57a7246159acd58ae7d5a0dfc8704b9795c894 --- vcl/source/app/svdata.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'vcl/source/app') diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index bfc2bb402ee7..ca815a2f3103 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -140,15 +140,9 @@ vcl::Window* ImplGetDefaultWindow() 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 ) - { -#ifdef DBG_UTIL - pContext->AddRef(NULL); -#else - pContext->AddRef(); -#endif - } + rtl::Reference pContext = pSVData->mpDefaultWin->GetGraphics()->GetOpenGLContext(); + if( pContext.is() ) + pContext->acquire(); } Application::GetSolarMutex().release(); } -- cgit