On Fri, 2008-08-22 at 19:08 +0200, Maximilian Albert wrote:
Maximilian Albert schrieb:
bulia byak schrieb:
On Fri, Aug 22, 2008 at 12:36 PM, Maximilian Albert
<Anhalter42@...173...> wrote:
Can anyone please confirm that this really fixes the issue? And
perhaps
even provide an explanation?
Fix confirmed, and looking at
http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/src/nodep...,
it appears pretty obvious to me at least for the Geometry tool crashes: since you now use this function not only in node tool, you need to check if it's a node tool context before taking its message context.
But that's exactly what the function get_message_context() does
(see
nodepath.cpp, line 844), which was introduced precisely for this purpose. :-/
Also, this doesn't explain why it didn't crash for me at all (and apparently neither for other people) when compiling without -O2.
I think I finally tracked it down.
With tonight's compile I saw a warning that led me to look into get_message_context(). It turns out that the function had an early return statement, but was missing a line to actually return a value. That happens to be one of the problems with code with multiple returns: hard to note a case where the wrong thing is returned or not returned.
I cleaned it up and removed the work-around and it seems happy with a base compile and with running under valgrind.
However, it would be good if people checked to see that all of the cleanup did not introduce any other problems. I did some extra code review and some simple tests here, but it's best to be gone over.
Thanks.