discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=32d7381a649f44f6f12ee55f41ecc1580c246e75

commit 32d7381a649f44f6f12ee55f41ecc1580c246e75
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Aug 13 15:45:19 2015 -0400

    cnp: redo wayland drop to nul terminate for text_uri drops and free on 
every drop
    
    @fix
---
 src/lib/elm_cnp.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 22bb770..d9e6c51 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -3238,18 +3238,14 @@ _wl_dropable_data_handle(Wl_Cnp_Selection *sel, char 
*data, size_t size)
              if (cbs->types & drop->last.format)
                {
                   s = (char*)eina_memdup((unsigned char*)data, size,
-                                         _wl_dropable_match(cbs, drop, 
ELM_SEL_FORMAT_TEXT));
+                      savedtypes.textreq || _wl_dropable_match(cbs, drop, 
ELM_SEL_FORMAT_TEXT));
                   if (!s)
                     {
                        ecore_wl_dnd_drag_end(ecore_wl_input_get());
                        return;
                     }
 
-                  if (savedtypes.textreq)
-                    {
-                       savedtypes.textreq = 0;
-                       savedtypes.imgfile = s;
-                    }
+                  sdata.data = s;
                   if (_wl_dropable_match(cbs, drop, ELM_SEL_FORMAT_IMAGE))
                     {
                        /* If it's markup that also supports images */
@@ -3257,19 +3253,16 @@ _wl_dropable_data_handle(Wl_Cnp_Selection *sel, char 
*data, size_t size)
                          sdata.format = ELM_SEL_FORMAT_MARKUP;
                        else
                          sdata.format = ELM_SEL_FORMAT_IMAGE;
-                       sdata.data = (char *)savedtypes.imgfile;
                     }
                   else
-                    {
-                       sdata.format = drop->last.format;
-                       sdata.data = s;
-                    }
+                    sdata.format = drop->last.format;
                   if (cbs->dropcb) cbs->dropcb(cbs->dropdata, drop->obj, 
&sdata);
+                  free(s);
                }
           }
      }
    ecore_wl_dnd_drag_end(ecore_wl_input_get());
-   ELM_SAFE_FREE(savedtypes.imgfile, free);
+   savedtypes.textreq = 0;
 }
 
 static Dropable *

-- 


Reply via email to