Commit 12530e21 authored by Ell's avatar Ell

app: add gimp_tile_handler_validate_unassign()

... which should be used to properly remove a
GimpTileHandlerValidate from a buffer, instead of using
gegl_buffer_remove_handler() directly.

Use gimp_tile_handler_validate_unassign(), instead of
gegl_buffer_remove_handler(), in gimp_projection_free_buffer().
parent e1e4ba9c
......@@ -672,8 +672,10 @@ gimp_projection_free_buffer (GimpProjection *proj)
if (proj->priv->buffer)
{
if (proj->priv->validate_handler)
gegl_buffer_remove_handler (proj->priv->buffer,
proj->priv->validate_handler);
{
gimp_tile_handler_validate_unassign (proj->priv->validate_handler,
proj->priv->buffer);
}
g_clear_object (&proj->priv->buffer);
}
......
......@@ -365,6 +365,20 @@ gimp_tile_handler_validate_assign (GimpTileHandlerValidate *validate,
"gimp-tile-handler-validate", validate);
}
void
gimp_tile_handler_validate_unassign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer)
{
g_return_if_fail (GIMP_IS_TILE_HANDLER_VALIDATE (validate));
g_return_if_fail (GEGL_IS_BUFFER (buffer));
g_return_if_fail (gimp_tile_handler_validate_get_assigned (buffer) == validate);
g_object_set_data (G_OBJECT (buffer),
"gimp-tile-handler-validate", NULL);
gegl_buffer_remove_handler (buffer, validate);
}
GimpTileHandlerValidate *
gimp_tile_handler_validate_get_assigned (GeglBuffer *buffer)
{
......
......@@ -68,6 +68,8 @@ GeglTileHandler * gimp_tile_handler_validate_new (GeglNode
void gimp_tile_handler_validate_assign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
void gimp_tile_handler_validate_unassign (GimpTileHandlerValidate *validate,
GeglBuffer *buffer);
GimpTileHandlerValidate * gimp_tile_handler_validate_get_assigned (GeglBuffer *buffer);
void gimp_tile_handler_validate_invalidate (GimpTileHandlerValidate *validate,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment