Logo Search packages:      
Sourcecode: inkscape version File versions

static void sp_knot_dispose ( GObject *  object  )  [static]

Called before SPKnot destruction.

Definition at line 223 of file knot.cpp.

References SPKnot::_event_handler_id, SPKnot::cursor, SPKnot::flags, SPKnot::item, and SPKnot::tip.

Referenced by sp_knot_class_init().

{
    SPKnot *knot = (SPKnot *) object;

    if ((knot->flags & SP_KNOT_GRABBED) && gdk_pointer_is_grabbed ()) {
        // This happens e.g. when deleting a node in node tool while dragging it
        gdk_pointer_ungrab (GDK_CURRENT_TIME);
    }

    if (knot->_event_handler_id > 0)
        {
        g_signal_handler_disconnect(G_OBJECT (knot->item), knot->_event_handler_id);
        knot->_event_handler_id = 0;
        }

    if (knot->item) {
        gtk_object_destroy (GTK_OBJECT (knot->item));
        knot->item = NULL;
    }

    for (gint i = 0; i < SP_KNOT_VISIBLE_STATES; i++) {
        if (knot->cursor[i]) {
            gdk_cursor_unref(knot->cursor[i]);
            knot->cursor[i] = NULL;
        }
    }

    if (knot->tip) {
        g_free(knot->tip);
        knot->tip = NULL;
    }

    if (parent_class->dispose) {
        (*parent_class->dispose) (object);
    }
}


Generated by  Doxygen 1.6.0   Back to index