X-Git-Url: http://pileus.org/git/?p=grits;a=blobdiff_plain;f=src%2Fobjects%2Fgrits-object.h;fp=src%2Fobjects%2Fgrits-object.h;h=2c11cd3ba1751d9d64a35ef42ad0e4eaa4d18e7d;hp=728ac720d9165bd2658ca2121091e8751906d04a;hb=67a63167629adc48ff31530dd58ece577f3d7460;hpb=8a508b43a6c1498cdfb181cc8580fafa1e07ff89 diff --git a/src/objects/grits-object.h b/src/objects/grits-object.h index 728ac72..2c11cd3 100644 --- a/src/objects/grits-object.h +++ b/src/objects/grits-object.h @@ -101,6 +101,30 @@ void grits_object_queue_draw(GritsObject *object); */ void grits_object_set_cursor(GritsObject *object, GdkCursorType cursor); +/** + * grits_object_destroy: + * @object: The #GritsObject to destroy + * + * Removes the widget from it's current viewer (if it has one) and decrements + * it's reference count. + */ +void grits_object_destroy(GritsObject *object); + +/** + * grits_object_destroy_pointer: + * @object: The pointer to the #GritsObject to destroy + * + * This functions the same as grits_object_destroy, except that the location of + * the object is set to null before proceeding. + */ +#define grits_object_destroy_pointer(object) ({ \ + if (*object) { \ + GritsObject *tmp = GRITS_OBJECT(*object); \ + *object = NULL; \ + grits_object_destroy(tmp); \ + } \ +}) + /** * grits_object_center: * @object: The #GritsObject to get the center of