Besides the casting ... (where I'd also prefer the c++ casts, expect for the specific cases of GObjects where the style casts explained in a former mail could be used)

... are you sure that priv is pointing to an object and that it is not NULL?
Whether or not the rest of the code is working correctly, it is strongly avisable to always check wether a pointer is not NULL before using it (here in priv->nodes).

Op 28/08/2013 20:50, Arshdeep Singh schreef:
I guess you are correct Krzysztof. Making the 'add_node_to_recolor_wheel' function empty stops Inkscape from crashing. So the problem has to lie in the casting. I have also tried :

RecolorWheelPrivate *priv;
// followed by the code (priv->nodes).insert( std::pair<std::string,RecolorWheelNode>(name,node) );

but this again leads to a crash. 

Finally, atleast the brickwall is clear to us. Now all we need is a road roller :)
so the function crashing Inkscape is:

void add_node_to_recolor_wheel (RecolorWheel *wheel, std::string name, RecolorWheelNode node)
    RecolorWheelPrivate *priv  = (RecolorWheelPrivate*) (wheel->priv);
    (priv->nodes).insert( std::pair<std::string,RecolorWheelNode>(name,node) );