diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-13 11:40:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-13 11:40:58 +0200 |
commit | 722f4e1d86710f2facd37d7e040df9e1fd585e26 (patch) | |
tree | 2c138372326ba057b34083c299857b833e2b8752 | |
parent | 36569a870ff8be8eb62a453bb8fbe97a4d3c705a (diff) |
tdf#104573 - Assertion failed: SolarMutex not locked
Change-Id: I91d95e73a7e0831f6667f440dd43567ac55b0529
-rw-r--r-- | vcl/source/app/vclevent.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 16 |
2 files changed, 22 insertions, 6 deletions
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 2cab94c4561e..4fec056aeb00 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -92,11 +92,17 @@ VclWindowEvent::VclWindowEvent( vcl::Window* pWin, VclEventId n, void* pDat ) : VclWindowEvent::~VclWindowEvent() {} VclMenuEvent::VclMenuEvent( Menu* pM, VclEventId n, sal_uInt16 nPos ) - : VclSimpleEvent(n), pMenu(pM), mnPos(nPos) -{} + : VclSimpleEvent(n), mnPos(nPos) +{ + SolarMutexGuard aGuard; + pMenu = pM; +} VclMenuEvent::~VclMenuEvent() -{} +{ + SolarMutexGuard aGuard; + pMenu.clear(); +} Menu* VclMenuEvent::GetMenu() const { diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 00b931e32ba9..90bd8af3b1a2 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1407,6 +1407,7 @@ void Menu::ImplAddDel( ImplMenuDelData& rDel ) SAL_WARN_IF( rDel.mpMenu, "vcl", "Menu::ImplAddDel(): cannot add ImplMenuDelData twice !" ); if( !rDel.mpMenu ) { + SolarMutexGuard aGuard; rDel.mpMenu = this; rDel.mpNext = mpFirstDel; mpFirstDel = &rDel; @@ -1415,7 +1416,10 @@ void Menu::ImplAddDel( ImplMenuDelData& rDel ) void Menu::ImplRemoveDel( ImplMenuDelData& rDel ) { - rDel.mpMenu = nullptr; + { + SolarMutexGuard aGuard; + rDel.mpMenu = nullptr; + } if ( mpFirstDel == &rDel ) { mpFirstDel = rDel.mpNext; @@ -2601,7 +2605,10 @@ bool Menu::HandleMenuActivateEvent( Menu *pMenu ) const { ImplMenuDelData aDelData( this ); - pMenu->pStartedFrom = const_cast<Menu*>(this); + { + SolarMutexGuard aGuard; + pMenu->pStartedFrom = const_cast<Menu*>(this); + } pMenu->bInCallback = true; pMenu->Activate(); @@ -2617,7 +2624,10 @@ bool Menu::HandleMenuDeActivateEvent( Menu *pMenu ) const { ImplMenuDelData aDelData( this ); - pMenu->pStartedFrom = const_cast<Menu*>(this); + { + SolarMutexGuard aGuard; + pMenu->pStartedFrom = const_cast<Menu*>(this); + } pMenu->bInCallback = true; pMenu->Deactivate(); if( !aDelData.isDeleted() ) |