From: cilix42 Date: Fri, 22 Aug 2008 15:35:40 +0000 (+0000) Subject: Hopefully fix for the recently experienced crashes when building with -O2. I don... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c51b062501cdabfafcab477bccef3ee96c1e563e;p=inkscape.git Hopefully fix for the recently experienced crashes when building with -O2. I don't understand why it works, please have a look at this yourself (also see post on the mailing list). --- diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 20c6346e0..3544b7441 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -3921,7 +3921,14 @@ static void node_handle_moved(SPKnot *knot, NR::Point *p, guint state, gpointer if (!desktop) return; SPEventContext *ec = desktop->event_context; if (!ec) return; - Inkscape::MessageContext *mc = get_message_context(ec); + + // FIXME: this is an ad-hoc crash fix but we need to find a better way (which also works in LPEToolContext) + //Inkscape::MessageContext *mc = get_message_context(ec); + if (!SP_IS_NODE_CONTEXT(ec)) { + return; + } + Inkscape::MessageContext *mc = SP_NODE_CONTEXT(ec)->_node_message_context; + if (!mc) return; double degrees = 180 / M_PI * rnew.a; @@ -4746,7 +4753,14 @@ sp_nodepath_update_statusbar(Inkscape::NodePath::Path *nodepath)//!!!move to Sha SPEventContext *ec = desktop->event_context; if (!ec) return; - Inkscape::MessageContext *mc = get_message_context(ec); + + // FIXME: this is an ad-hoc crash fix but we need to find a better way (which also works in LPEToolContext) + //Inkscape::MessageContext *mc = get_message_context(ec); + if (!SP_IS_NODE_CONTEXT(ec)) { + return; + } + + Inkscape::MessageContext *mc = SP_NODE_CONTEXT(ec)->_node_message_context; if (!mc) return; inkscape_active_desktop()->emitToolSubselectionChanged(NULL);