Logo Search packages:      
Sourcecode: inkscape version File versions

void sp_nodepath_destroy ( Inkscape::NodePath::Path np  ) 

Destroys nodepath's subpaths, then itself, also tell parent ShapeEditor about it.

Definition at line 278 of file nodepath.cpp.

References Inkscape::NodePath::Path::curve, Inkscape::NodePath::Path::desktop, Inkscape::NodePath::Path::helper_path, Inkscape::NodePath::Path::livarot_path, Inkscape::NodePath::Path::repr_key, Inkscape::NodePath::Path::repr_nodetypes_key, Inkscape::NodePath::Path::selected, Inkscape::NodePath::Path::shape_editor, sp_curve_unref(), sp_nodepath_subpath_destroy(), and Inkscape::NodePath::Path::subpaths.

                                                   {

    if (!np)  //soft fail, like delete
        return;

    while (np->subpaths) {
        sp_nodepath_subpath_destroy((Inkscape::NodePath::SubPath *) np->subpaths->data);
    }

    //Inform the ShapeEditor that made me, if any, that I am gone.
    if (np->shape_editor)
        np->shape_editor->nodepath_destroyed();

    g_assert(!np->selected);

    if (np->livarot_path) {
        delete np->livarot_path;
        np->livarot_path = NULL;
    }

    if (np->helper_path) {
        GtkObject *temp = np->helper_path;
        np->helper_path = NULL;
        gtk_object_destroy(temp);
    }
    if (np->curve) {
        sp_curve_unref(np->curve);
        np->curve = NULL;
    }

    if (np->repr_key) {
        g_free(np->repr_key);
        np->repr_key = NULL;
    }
    if (np->repr_nodetypes_key) {
        g_free(np->repr_nodetypes_key);
        np->repr_nodetypes_key = NULL;
    }

    np->desktop = NULL;

    g_free(np);
}


Generated by  Doxygen 1.6.0   Back to index