looking at your code I found this comment:

  /* it seems that the layer must be added to the image before
     it can be removed from gimp's memory */

  gimp_image_add_layer (image_ID_global, bp->layer_ID, 0);
  gimp_drawable_detach (bp->drawable);
  gimp_image_remove_layer (image_ID_global, bp->layer_ID );

You should be able to remove the layer from gimp's memory without
adding it to an image first by using gimp_layer_delete(). This
function exists solely to get rid of a layer that hasn't been added
to an image yet (in other words, a floating layer).

Salut, Sven
Gimp-developer mailing list

Reply via email to