diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-03-18 02:01:19 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-03-18 02:01:19 +0000 |
| commit | acdd4c313e57397772e0d6ecbb55303a2b833210 (patch) | |
| tree | 5bc70165b96eb1157fde9a1a03e3c796b0c1c30f /src/flood-context.cpp | |
| parent | use UTF-8 for degree symbol (diff) | |
| download | inkscape-acdd4c313e57397772e0d6ecbb55303a2b833210.tar.gz inkscape-acdd4c313e57397772e0d6ecbb55303a2b833210.zip | |
fix crash when you quickly click in two areas and then press a key to go to another tool before filling is finished
(bzr r2683)
Diffstat (limited to 'src/flood-context.cpp')
| -rw-r--r-- | src/flood-context.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 367e56a3d..648d00bcb 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -779,15 +779,20 @@ static gint sp_flood_context_root_handler(SPEventContext *event_context, GdkEven if (!(event->button.state & GDK_CONTROL_MASK)) { // set "busy" cursor desktop->setWaitingCursor(); + + if (SP_IS_EVENT_CONTEXT(event_context)) { + // Since setWaitingCursor runs main loop iterations, we may have already left this tool! + // So check if the tool is valid before doing anything + + sp_flood_do_flood_fill(event_context, event); - sp_flood_do_flood_fill(event_context, event); - - // restore cursor when done; note that it may already be different if e.g. user - // switched to another tool during interruptible tracing or drawing, in which case do nothing - if (desktop->waiting_cursor) - sp_event_context_update_cursor(event_context); + // restore cursor when done; note that it may already be different if e.g. user + // switched to another tool during interruptible tracing or drawing, in which case do nothing + if (desktop->waiting_cursor) + sp_event_context_update_cursor(event_context); - ret = TRUE; + ret = TRUE; + } } } break; |
