summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-07-23 10:54:44 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-19 21:32:14 +0200
commitf9eddb62f25a54370164b56c313dbb11f0cde995 (patch)
tree2b2cc73fd82e2fa447b9fffaf5ec7f00ca0e897a
parent3f7f3df5d9ab6b5266a90b899b6ecf5c04ca096d (diff)
Resolves: tdf#93778 fixed crash
While opening folders in SvtFileView using doubleclick, sometimes GtkSalFrame::gestureLongPress method is executed with a null frame pointer and LO crashes. I noticed this only with remote dirs, probably this bug occurs only when the doubleclick handler routine takes a lot of time. (cherry picked from commit db33c7853e12e9593a530ce2327e9662bcab1480) Change-Id: I432046994b3e1662bd7e499681bd20e9696b2d52 Reviewed-on: https://gerrit.libreoffice.org/18571 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 7f8570e3a751..347497c2acb9 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3541,15 +3541,18 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame)
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- SalLongPressEvent aEvent;
+ if(pThis)
+ {
+ SalLongPressEvent aEvent;
- gdouble x, y;
- GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
- gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
- aEvent.mnX = x;
- aEvent.mnY = y;
+ gdouble x, y;
+ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
+ gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
+ aEvent.mnX = x;
+ aEvent.mnY = y;
- pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+ pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+ }
}
#endif