Bugs item #2096641, was opened at 2008-09-06 10:57 Message generated for change (Comment added) made by genete You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=757416&aid=2096641&group_id=144022
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Crasher/nasty bug Group: SVN version >Status: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Genete (genete) Assigned to: Genete (genete) Summary: Not handled exception when remove all gradient Cpoints Initial Comment: Using SVN 2039 Open the gradient editor dialog. Right click over each any existing triangle slider and select "Delete". The gradient becomes transparent. Now click on the area where the triangle sliders were. It crashed with this message: glibmm-ERROR **: unhandled exception (type std::exception) in signal handler: what: synfig::Gradient::find(): Unable to find UniqueID in gradient ---------------------------------------------------------------------- >Comment By: Genete (genete) Date: 2008-09-14 23:17 Message: Applied the patch from dooglus in svn 2056. ---------------------------------------------------------------------- Comment By: dooglus (dooglus) Date: 2008-09-14 18:37 Message: How about this 3rd patch? Just return early if the gradient is empty. File Added: bug_2096641_patch3.txt ---------------------------------------------------------------------- Comment By: dooglus (dooglus) Date: 2008-09-14 15:17 Message: It should be an error for find() to be called with a cpoint that doesn't exist. I don't think it's a good idea to remove the exception raising behaviour in that case. A better fix for this bug would be to stop find() being called when there are no cpoints in the gradient. Note also that there are two functions which both raise exceptions when the cpoint can't be found. If we're going to change the behaviour of one, shouldn't we also change the other too? synfig::Gradient::iterator synfig::Gradient::find(const UniqueID &id) synfig::Gradient::const_iterator synfig::Gradient::find(const UniqueID &id)const ---------------------------------------------------------------------- Comment By: Genete (genete) Date: 2008-09-13 13:32 Message: I've set another solution for this: Modify the synfig-core/src/synfig/gradient.cpp file instead and catch the exception returning a valid iterator begin() See attached patch file. File Added: bug_2096641_patch2.txt ---------------------------------------------------------------------- Comment By: Paul Wise (pabs3) Date: 2008-09-13 12:24 Message: Looks like a bug in the synfig::Gradient::proximity function, I think it shouldn't use iter-- at the end of the function. ---------------------------------------------------------------------- Comment By: Genete (genete) Date: 2008-09-13 11:54 Message: But in which situation someone would like to delete all the Cpoints?... I know what you mean. You prefer that I caught the exception with a "try" command in the gradient.cpp file, right? ---------------------------------------------------------------------- Comment By: Paul Wise (pabs3) Date: 2008-09-13 11:39 Message: Hmm, I don't think this is the right place to fix this. Either the erase function should fail to remove the last cpoint or synfigstudio should not crash when no cpoints are in the gradient. Personally I think removing all cpoints is a valid thing to do so the crash should be avoided instead. ---------------------------------------------------------------------- Comment By: Genete (genete) Date: 2008-09-13 11:31 Message: This patch can solve the bug. See attached file. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=757416&aid=2096641&group_id=144022 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Synfig-devl mailing list Synfig-devl@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synfig-devl