From a1bc2cb10e1cc6fa05b04c85f98cf0622afe99f1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 7 Jul 2014 08:00:20 -0400 Subject: [PATCH] fix potential crash if certain Canvas methods are used before its window is realized --- libs/canvas/canvas.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 79a4f203c6..adf0498128 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -454,9 +454,15 @@ GtkCanvas::deliver_enter_leave (Duple const & point, int state) { /* setup enter & leave event structures */ + Glib::RefPtr win = get_window(); + + if (!win) { + return; + } + GdkEventCrossing enter_event; enter_event.type = GDK_ENTER_NOTIFY; - enter_event.window = get_window()->gobj(); + enter_event.window = win->gobj(); enter_event.send_event = 0; enter_event.subwindow = 0; enter_event.mode = GDK_CROSSING_NORMAL;