summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2015-09-07 17:43:04 -0400
committerAndras Timar <andras.timar@collabora.com>2016-06-12 22:43:30 +0200
commit0da9ee6aa521b8a5c8606f45d17e796a7e2b1f57 (patch)
treec9ae0fa33aaed4db539f12e0b95368626227d198 /vcl
parent77e5a301643ff13b02246083945eb3216c79726d (diff)
vcl: assign NULL 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 NULL after the delete. Change-Id: I65ecfc2d2694a981ec2986988efabdfd28d0cce4 (cherry picked from commit fca0980ec866279cc40ed1233bbddb2e4abe2fae) (cherry picked from commit 48eac22cce93c08d13022a7215b9549379453695)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/svdata.cxx4
-rw-r--r--vcl/source/app/svmain.cxx8
2 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index fbde610f62f0..b830f83ec3cc 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 = NULL;
if( pSVData->mpDockingManager )
- delete pSVData->mpDockingManager;
+ delete pSVData->mpDockingManager, pSVData->mpDockingManager = NULL;
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 d2c13f7a7b8e..e6f4be145de0 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -394,7 +394,7 @@ void DeInitVCL()
delete pSVData->mpSettingsConfigItem, pSVData->mpSettingsConfigItem = nullptr;
if ( pSVData->maAppData.mpIdleMgr )
- delete pSVData->maAppData.mpIdleMgr;
+ delete pSVData->maAppData.mpIdleMgr, pSVData->maAppData.mpIdleMgr = NULL;
Scheduler::ImplDeInitScheduler();
if ( pSVData->maWinData.mpMsgBoxImgList )
@@ -564,7 +564,11 @@ void DeInitVCL()
pSVData->mpSalTimer = nullptr;
// Deinit Sal
- DestroySalInstance( pSVData->mpDefInst );
+ if (pSVData->mpDefInst)
+ {
+ DestroySalInstance( pSVData->mpDefInst );
+ pSVData->mpDefInst = NULL;
+ }
if( pOwnSvApp )
{