diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-19 07:24:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-19 14:57:13 +0200 |
commit | 8b65a61788aa18e97de068bc75fdeecb20a23026 (patch) | |
tree | f9650dbd0c583b889bd018be9f11313337fe9703 | |
parent | b3f4709d739743d744b8bb4c2231bb80772af2f6 (diff) |
fix intermittent crash in make check
The original crash was in GtkSalMenu::Active, triggered from
RefreshMenusUnity and it looked like the refresh method was accessing
already freed memory.
Change-Id: Ib07d839a976869eb8719e71e0653f1a72e3b0e80
-rw-r--r-- | vcl/unx/gtk/window/gtksalmenu.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx index dcbcd78425c6..92176b7467fc 100644 --- a/vcl/unx/gtk/window/gtksalmenu.cxx +++ b/vcl/unx/gtk/window/gtksalmenu.cxx @@ -450,9 +450,18 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig pItem->mpSubMenu = pGtkSubMenu; } +class GdkThreadLock +{ +public: + GdkThreadLock() { gdk_threads_enter(); } + ~GdkThreadLock() { gdk_threads_leave(); } +}; + static bool bInvalidMenus = false; static gboolean RefreshMenusUnity(gpointer) { + GdkThreadLock aLock; + SalDisplay* pSalDisplay = GetGenericData()->GetSalDisplay(); std::list< SalFrame* >::const_iterator pSalFrame = pSalDisplay->getFrames().begin(); std::list< SalFrame* >::const_iterator pEndSalFrame = pSalDisplay->getFrames().end(); |