From c5572c3743c47b66ed0138856cb962932517f5bc Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 14 Sep 2009 03:28:30 +0000 Subject: [PATCH] fix crash when exiting with 3dbox tool active --- src/box3d-context.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 128b5f2ff..e3476deb3 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -625,10 +625,14 @@ static void sp_box3d_drag(Box3DContext &bc, guint /*state*/) static void sp_box3d_finish(Box3DContext *bc) { bc->_message_context->clear(); - g_assert (SP_ACTIVE_DOCUMENT->current_persp3d); + bc->ctrl_dragged = false; + bc->extruded = false; if ( bc->item != NULL ) { SPDesktop * desktop = SP_EVENT_CONTEXT_DESKTOP(bc); + SPDocument *doc = sp_desktop_document(desktop); + if (!doc || !doc->current_persp3d) + return; SPBox3D *box = SP_BOX3D(bc->item); @@ -647,9 +651,6 @@ static void sp_box3d_finish(Box3DContext *bc) bc->item = NULL; } - - bc->ctrl_dragged = false; - bc->extruded = false; } void sp_box3d_context_update_lines(SPEventContext *ec) { -- 2.30.2