void RecolorArtworkWidget::performUpdate()
{
if ( update || !desktop ) {
return;
}
if ( dragId ) {
// local change; do nothing, but reset the flag
g_source_remove(dragId);
dragId = 0;
return;
}
update = true;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
GSList const *items = NULL;
//int selObj = 0;
if ( selection )
{
items = selection->itemList();
//selObj = g_slist_length (const_cast<GSList*>(items));
RecolorWheel* wheel = (RecolorWheel*) (((RecolorWheelSelector*)(rsel))->getWheel()) ;
RecolorWheelNode temp;
for (GSList const *i = items; i != NULL; i = i->next)
{
SPObject *obj=reinterpret_cast<SPObject *>(i->data);
Inkscape::XML::Node* obj_repr = obj->getRepr();
SPCSSAttr* obj_css = sp_repr_css_attr( obj_repr , "style" );
guint32 rgb32 = sp_svg_read_color( sp_repr_css_property( obj_css, "fill", "#ababab") , 0xF0F8FF );
SPColor color = SPColor (rgb32);
float rgb[3] , hsv[3];
sp_color_get_rgb_floatv (&color, rgb);
sp_color_rgb_to_hsv_floatv (hsv , temp._color[0] , temp._color[1] , temp._color[2] );
add_node_to_recolor_wheel (wheel, obj->getId() , temp );
}
}
update = false;
}
There seems to be some runtime error. Opening the RecolorArtwork Dialogbox crashes inkscape. Running gdb shows the warning that "HEAP: Free heap block a90b8f6 modified at a90b8f6 after it was freed" .
Can't figure out whats making the application to crash.
I have uploaded this branch too. It is the latest revision.