From ac7732e6b389dd4acd57bb381cf58701a68c2458 Mon Sep 17 00:00:00 2001 From: johncoswell Date: Sun, 16 Dec 2007 15:29:30 +0000 Subject: [PATCH] fix possible crash where event_context is destroyed during fill operation due to tool switch --- src/flood-context.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 86f6687e3..5838c2b59 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -1044,7 +1044,7 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven event_context->xp = (gint) button_w[NR::X]; event_context->yp = (gint) button_w[NR::Y]; event_context->within_tolerance = true; - + dragging = true; NR::Point const p(desktop->w2d(button_w)); @@ -1100,7 +1100,10 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven } r->stop(); - event_context->defaultMessageContext()->clear(); + + if (SP_IS_EVENT_CONTEXT(event_context)) { + event_context->defaultMessageContext()->clear(); + } } } break; -- 2.30.2