[gimp] app: use gimp_drawable_steal_buffer() in gimp_text_layer_from_layer()



commit 3b8e1ebecb55b36dd1bff6b0af23c4d3d4b1484b
Author: Ell <ell_se yahoo com>
Date:   Tue Feb 13 13:22:08 2018 -0500

    app: use gimp_drawable_steal_buffer() in gimp_text_layer_from_layer()
    
    When constructing a text layer from an existing layer in
    gimp_text_layer_from_layer(), steal the old layer's buffer using
    the new gimp_drawable_steal_buffer(), instead of using simple
    pointer assignment, as the latter is generaly unsafe (even though
    it should currently work).

 app/text/gimptextlayer-xcf.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/app/text/gimptextlayer-xcf.c b/app/text/gimptextlayer-xcf.c
index 982cc96..8e9734e 100644
--- a/app/text/gimptextlayer-xcf.c
+++ b/app/text/gimptextlayer-xcf.c
@@ -195,8 +195,7 @@ gimp_text_layer_from_layer (GimpLayer *layer,
 
   drawable = GIMP_DRAWABLE (text_layer);
 
-  drawable->private->buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
-  GIMP_DRAWABLE (layer)->private->buffer = NULL;
+  gimp_drawable_steal_buffer (drawable, GIMP_DRAWABLE (layer));
 
   gimp_layer_set_opacity         (GIMP_LAYER (text_layer),
                                   gimp_layer_get_opacity (layer), FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]