[Libreoffice-commits] core.git: vcl/unx

Eike Rathke erack at redhat.com
Thu Jun 29 12:03:56 UTC 2017


 vcl/unx/gtk3/gtk3gtkframe.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 637d917d7551fed19c9685f974fb3e732a8f97e2
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Jun 29 14:02:58 2017 +0200

    Don't let m_nGrabLevel become negative, tdf#108705 related
    
    ... which then later leads to 2 Giga loops on the next GtkSalFrame dtor call,
    for example on the second AutoFilter button popup in Calc.
    
    Fall-out from
    
        commit 9b32355ea6d8d5e34363ba0c57e74d75d7a7b1b7
        Date:   Fri Jun 23 12:48:12 2017 +0100
    
            Resolves: tdf#108705 remove grabs on widget before destroying it
    
    that brought this to surface.
    
    Change-Id: I0edb7eec9384c716800f07ef1ed91fc8f1d7c119

diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 30a0e2787355..7cfaf9b2c04a 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2573,9 +2573,12 @@ void GtkSalFrame::addGrabLevel()
 
 void GtkSalFrame::removeGrabLevel()
 {
-    --m_nGrabLevel;
-    if (m_nGrabLevel == 0)
-        gtk_grab_remove(getMouseEventWidget());
+    if (m_nGrabLevel > 0)
+    {
+        --m_nGrabLevel;
+        if (m_nGrabLevel == 0)
+            gtk_grab_remove(getMouseEventWidget());
+    }
 }
 
 void GtkSalFrame::closePopup()


More information about the Libreoffice-commits mailing list