billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=80124a72ca2d71c31ee5b9c0b446881fd8e40131

commit 80124a72ca2d71c31ee5b9c0b446881fd8e40131
Author: Boris Faure <bill...@gmail.com>
Date:   Thu Oct 10 22:55:21 2019 +0200

    win: no longer segfaults from typop with multiple files
---
 src/bin/win.c | 49 ++++++++++++++++++++++++-------------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/src/bin/win.c b/src/bin/win.c
index 6ff4daa..09c6bc4 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -4085,6 +4085,24 @@ _cb_media_loop(void *data,
      }
 }
 
+static void
+_popmedia_queue_add(Term *term, const char *src,
+                    Eina_Bool from_user_interaction)
+{
+   struct Pop_Media *pm = calloc(1, sizeof(struct Pop_Media));
+
+   if (!pm)
+     return;
+
+   pm->src = eina_stringshare_add(src);
+   pm->from_user_interaction = from_user_interaction;
+
+   term->popmedia_queue = eina_list_append(term->popmedia_queue, pm);
+   if (!term->popmedia)
+     _popmedia_queue_process(term);
+}
+
+
 static void
 _popmedia_show(Term *term, const char *src, Media_Type type)
 {
@@ -4094,14 +4112,15 @@ _popmedia_show(Term *term, const char *src, Media_Type 
type)
    EINA_SAFETY_ON_NULL_RETURN(config);
    if (term->popmedia)
      {
-        const char *s;
+        struct Pop_Media *pm;
 
-        EINA_LIST_FREE(term->popmedia_queue, s)
+        /* Flush queue */
+        EINA_LIST_FREE(term->popmedia_queue, pm)
           {
-             eina_stringshare_del(s);
+             eina_stringshare_del(pm->src);
           }
-        term->popmedia_queue = eina_list_append(term->popmedia_queue,
-                                                eina_stringshare_add(src));
+        /* queue new item */
+        _popmedia_queue_add(term, src, EINA_FALSE);
         edje_object_signal_emit(term->bg, "popmedia,off", "terminology");
         return;
      }
@@ -4162,7 +4181,6 @@ _ty_http_head_delete(Ty_Http_Head *ty_head)
    free(ty_head);
 }
 
-
 static Eina_Bool
 _media_http_head_timeout(void *data)
 {
@@ -4307,8 +4325,6 @@ error:
      }
 }
 
-
-
 static void
 _popmedia_queue_process(Term *term)
 {
@@ -4326,23 +4342,6 @@ _popmedia_queue_process(Term *term)
    free(pm);
 }
 
-static void
-_popmedia_queue_add(Term *term, const char *src,
-                    Eina_Bool from_user_interaction)
-{
-   struct Pop_Media *pm = calloc(1, sizeof(struct Pop_Media));
-
-   if (!pm)
-     return;
-
-   pm->src = eina_stringshare_add(src);
-   pm->from_user_interaction = from_user_interaction;
-
-   term->popmedia_queue = eina_list_append(term->popmedia_queue, pm);
-   if (!term->popmedia)
-     _popmedia_queue_process(term);
-}
-
 static void
 _cb_popup(void *data,
           Evas_Object *_obj EINA_UNUSED,

-- 


Reply via email to