summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-09-07 17:43:04 -0400
committerTor Lillqvist <tml@collabora.com>2016-02-16 00:08:54 +0200
commit4886676a5b50caf0946b91491055cbdc2696f1ca (patch)
treeb42a5edab712fb220385a00ad6575a8dc847ed1a /vcl/source
parentb3e8406f53e29e4401d24b8aaa3020766cc61f02 (diff)
vcl: assign nullptr after deleting
In the preinit stage, the VCL initialization is done by the parent process and when the lo_startmain thread de-initialize the VCL, some services are disposed early, and it causes segmentation violation. So it is ensured that pointers to service objetcs is set nullptr after deleting. Change-Id: I65ecfc2d2694a981ec2986988efabdfd28d0cce4
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/svdata.cxx4
-rw-r--r--vcl/source/app/svmain.cxx10
2 files changed, 9 insertions, 5 deletions
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index c3fbdf518612..19c663a5b1f9 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -100,10 +100,10 @@ void ImplDeInitSVData()
// delete global instance data
if( pSVData->mpSettingsConfigItem )
- delete pSVData->mpSettingsConfigItem;
+ delete pSVData->mpSettingsConfigItem, pSVData->mpSettingsConfigItem = nullptr;
if( pSVData->mpDockingManager )
- delete pSVData->mpDockingManager;
+ delete pSVData->mpDockingManager, pSVData->mpDockingManager = nullptr;
if( pSVData->maCtrlData.mpFieldUnitStrings )
delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = nullptr;
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index f59f5f9bef7c..a8bac5775b59 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -386,7 +386,7 @@ void DeInitVCL()
delete pSVData->mpSettingsConfigItem, pSVData->mpSettingsConfigItem = nullptr;
if ( pSVData->maAppData.mpIdleMgr )
- delete pSVData->maAppData.mpIdleMgr;
+ delete pSVData->maAppData.mpIdleMgr, pSVData->maAppData.mpIdleMgr = nullptr;
Scheduler::ImplDeInitScheduler();
if ( pSVData->maWinData.mpMsgBoxImgList )
@@ -551,7 +551,11 @@ void DeInitVCL()
pSVData->mpSalTimer = nullptr;
// Deinit Sal
- DestroySalInstance( pSVData->mpDefInst );
+ if (pSVData->mpDefInst)
+ {
+ DestroySalInstance( pSVData->mpDefInst );
+ pSVData->mpDefInst = nullptr;
+ }
if( pOwnSvApp )
{
@@ -578,7 +582,7 @@ struct WorkerThreadData
static HANDLE hThreadID = 0;
static unsigned __stdcall _threadmain( void *pArgs )
{
- OleInitialize( NULL );
+ OleInitialize( nullptr );
((WorkerThreadData*)pArgs)->pWorker( ((WorkerThreadData*)pArgs)->pThreadData );
delete (WorkerThreadData*)pArgs;
OleUninitialize();