summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-12-26 17:51:17 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-02-12 11:19:28 +0100
commit616381e9cfed41b83fef039b0e38c09b41fd3d7f (patch)
tree22097da7fe43268e0f84e37dccd13b7962333214 /src/lib
parent48e5684b3c37b337edd7004e68fc0690b58a84e6 (diff)
ecore: get rid of commands in efl_task.
Note that the usage in efl_thread.c should and could be removed. the problem with its usage is that when the ARGUMENTS event is fired, noone ever had the chance to subscribe to the loop of the thread yet. So all in all this is unneccessary, since noone could ever touch that. Differential Revision: https://phab.enlightenment.org/D7517
Diffstat (limited to '')
-rw-r--r--src/lib/ecore/efl_app.eo2
-rw-r--r--src/lib/ecore/efl_appthread.eo2
-rw-r--r--src/lib/ecore/efl_exe.c4
-rw-r--r--src/lib/ecore/efl_exe.eo2
-rw-r--r--src/lib/ecore/efl_loop.c10
-rw-r--r--src/lib/ecore/efl_task.c298
-rw-r--r--src/lib/ecore/efl_task.eo77
-rw-r--r--src/lib/ecore/efl_thread.c71
-rw-r--r--src/lib/ecore/efl_thread.eo2
-rw-r--r--src/lib/ecore/meson.build1
10 files changed, 44 insertions, 425 deletions
diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo
index f90324b39d..e046428626 100644
--- a/src/lib/ecore/efl_app.eo
+++ b/src/lib/ecore/efl_app.eo
@@ -1,6 +1,6 @@
1import efl_types; 1import efl_types;
2 2
3class Efl.App extends Efl.Loop 3class Efl.App extends Efl.Loop implements Efl.Core.Command_Line
4{ 4{
5 [[ ]] 5 [[ ]]
6 data: null; 6 data: null;
diff --git a/src/lib/ecore/efl_appthread.eo b/src/lib/ecore/efl_appthread.eo
index c60308f468..82a9d77ace 100644
--- a/src/lib/ecore/efl_appthread.eo
+++ b/src/lib/ecore/efl_appthread.eo
@@ -1,4 +1,4 @@
1class Efl.Appthread extends Efl.Loop implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer 1class Efl.Appthread extends Efl.Loop implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line
2{ 2{
3 [[ ]] 3 [[ ]]
4 methods { 4 methods {
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index 4b3bc658d6..61ff4ba798 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -395,7 +395,7 @@ _efl_exe_efl_task_priority_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
395} 395}
396 396
397EOLIAN static Eina_Future * 397EOLIAN static Eina_Future *
398_efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) 398_efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
399{ 399{
400#ifdef _WIN32 400#ifdef _WIN32
401 return EINA_FALSE; 401 return EINA_FALSE;
@@ -414,7 +414,7 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd)
414 if (!td) return NULL; 414 if (!td) return NULL;
415 415
416 // get a cmdline to run 416 // get a cmdline to run
417 cmd = efl_task_command_get(obj); 417 cmd = efl_core_command_line_command_get(obj);
418 if (!cmd) return NULL; 418 if (!cmd) return NULL;
419 419
420 ret = pipe(pipe_exited); 420 ret = pipe(pipe_exited);
diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo
index 111814af21..b7f97da7dc 100644
--- a/src/lib/ecore/efl_exe.eo
+++ b/src/lib/ecore/efl_exe.eo
@@ -19,7 +19,7 @@ enum Efl.Exe_Flags {
19 hide_io = 4 19 hide_io = 4
20} 20}
21 21
22class Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer 22class Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer,Efl.Core.Command_Line
23{ 23{
24 [[ ]] 24 [[ ]]
25 methods { 25 methods {
diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c
index 68f9573b76..cf8600c998 100644
--- a/src/lib/ecore/efl_loop.c
+++ b/src/lib/ecore/efl_loop.c
@@ -383,17 +383,19 @@ _efl_loop_arguments_cleanup(Eo *o EINA_UNUSED, void *data, const Eina_Future *de
383EAPI void 383EAPI void
384ecore_loop_arguments_send(int argc, const char **argv) 384ecore_loop_arguments_send(int argc, const char **argv)
385{ 385{
386 Eina_Array *arga; 386 Eina_Array *arga, *cml;
387 int i = 0; 387 int i = 0;
388 388
389 efl_task_arg_reset(efl_main_loop_get());
390 arga = eina_array_new(argc); 389 arga = eina_array_new(argc);
390 cml = eina_array_new(argc);
391 for (i = 0; i < argc; i++) 391 for (i = 0; i < argc; i++)
392 { 392 {
393 eina_array_push(arga, eina_stringshare_add(argv[i])); 393 Eina_Stringshare *arg = eina_stringshare_add(argv[i]);
394 efl_task_arg_append(efl_main_loop_get(), argv[i]); 394 eina_array_push(arga, arg);
395 eina_array_push(cml, arg);
395 } 396 }
396 397
398 efl_core_command_line_command_array_set(efl_app_main_get(EFL_APP_CLASS), cml);
397 efl_future_then(efl_main_loop_get(), efl_loop_job(efl_main_loop_get()), 399 efl_future_then(efl_main_loop_get(), efl_loop_job(efl_main_loop_get()),
398 .success = _efl_loop_arguments_send, 400 .success = _efl_loop_arguments_send,
399 .free = _efl_loop_arguments_cleanup, 401 .free = _efl_loop_arguments_cleanup,
diff --git a/src/lib/ecore/efl_task.c b/src/lib/ecore/efl_task.c
index 311de0506a..d610fcbf8b 100644
--- a/src/lib/ecore/efl_task.c
+++ b/src/lib/ecore/efl_task.c
@@ -12,303 +12,6 @@
12 12
13////////////////////////////////////////////////////////////////////////// 13//////////////////////////////////////////////////////////////////////////
14 14
15static void
16_clear_args(Efl_Task_Data *pd)
17{
18 unsigned int count, i;
19
20 if (!pd->args) return;
21 count = eina_array_count(pd->args);
22 for (i = 0; i < count; i++)
23 eina_stringshare_del(eina_array_data_get(pd->args, i));
24 eina_array_free(pd->args);
25 pd->args = NULL;
26}
27
28static Eina_Array *
29_unescape(const char *s)
30{
31 Eina_Array *args;
32 const char *p;
33 char *tmp = NULL, *d = NULL;
34 if (!s) return NULL;
35
36 Eina_Bool in_quote_dbl = EINA_FALSE;
37 Eina_Bool in_quote = EINA_FALSE;
38
39 args = eina_array_new(16);
40 if (!args) return NULL;
41 for (p = s; *p; p++)
42 {
43 if (!tmp) tmp = d = strdup(p);
44 if (tmp)
45 {
46 if (in_quote_dbl)
47 {
48 switch (*p)
49 {
50 case '\"':
51 in_quote_dbl = EINA_FALSE;
52 *d = 0;
53 eina_array_push(args, eina_stringshare_add(tmp));
54 free(tmp);
55 tmp = d = NULL;
56 break;
57 case '\\':
58 p++;
59 EINA_FALLTHROUGH
60 default:
61 *d = *p;
62 d++;
63 break;
64 }
65 }
66 else if (in_quote)
67 {
68 switch (*p)
69 {
70 case '\'':
71 in_quote = EINA_FALSE;
72 *d = 0;
73 eina_array_push(args, eina_stringshare_add(tmp));
74 free(tmp);
75 tmp = d = NULL;
76 break;
77 case '\\':
78 p++;
79 EINA_FALLTHROUGH
80 default:
81 *d = *p;
82 d++;
83 break;
84 }
85 }
86 else
87 {
88 switch (*p)
89 {
90 case ' ':
91 case '\t':
92 case '\r':
93 case '\n':
94 *d = 0;
95 eina_array_push(args, eina_stringshare_add(tmp));
96 free(tmp);
97 tmp = d = NULL;
98 break;
99 case '\"':
100 in_quote_dbl = EINA_TRUE;
101 break;
102 case '\'':
103 in_quote = EINA_TRUE;
104 break;
105 case '\\':
106 p++;
107 EINA_FALLTHROUGH
108 default:
109 *d = *p;
110 d++;
111 break;
112 }
113 }
114 }
115 }
116 if (tmp)
117 {
118 *d = 0;
119 eina_array_push(args, eina_stringshare_add(tmp));
120 free(tmp);
121 }
122 return args;
123}
124
125static char *
126_escape(const char *s)
127{
128 Eina_Bool need_quote = EINA_FALSE;
129 const char *p;
130 char *s2 = malloc((strlen(s) * 2) + 1 + 2), *d;
131
132 if (!s2) return NULL;
133
134 for (p = s; *p; p++)
135 {
136 switch (*p)
137 {
138 case '\'':
139 case '\"':
140 case '$':
141 case '#':
142 case ';':
143 case '&':
144 case '`':
145 case '|':
146 case '(':
147 case ')':
148 case '[':
149 case ']':
150 case '{':
151 case '}':
152 case '>':
153 case '<':
154 case '\n':
155 case '\r':
156 case '\t':
157 need_quote = EINA_TRUE;
158 default:
159 break;
160 }
161 }
162
163 d = s2;
164 if (need_quote)
165 {
166 *d = '\"';
167 d++;
168 }
169 for (p = s; *p; p++, d++)
170 {
171 switch (*p)
172 {
173 case ' ':
174 case '\\':
175 case '\'':
176 case '\"':
177 *d = '\\';
178 d++;
179 EINA_FALLTHROUGH
180 default:
181 *d = *p;
182 break;
183 }
184 }
185 if (need_quote)
186 {
187 *d = '\"';
188 d++;
189 }
190 *d = 0;
191 return s2;
192}
193
194static void
195_rebuild_command(Efl_Task_Data *pd)
196{
197 unsigned int count, i;
198 Eina_Strbuf *sb;
199 const char *arg, *cmd;
200 Eina_Bool have_args = EINA_FALSE;
201
202 if (!pd->command_dirty) return;
203 pd->command_dirty = EINA_FALSE;
204 eina_stringshare_del(pd->command);
205 pd->command = NULL;
206 if (!pd->args) return;
207 sb = eina_strbuf_new();
208 if (!sb) return;
209 count = eina_array_count(pd->args);
210 for (i = 0; i < count; i++)
211 {
212 arg = eina_array_data_get(pd->args, i);
213 if (arg)
214 {
215 char *str = _escape(arg);
216 if (str)
217 {
218 if (have_args) eina_strbuf_append(sb, " ");
219 eina_strbuf_append(sb, str);
220 free(str);
221 have_args = EINA_TRUE;
222 }
223 }
224 }
225 cmd = eina_strbuf_string_get(sb);
226 if (cmd) pd->command = eina_stringshare_add(cmd);
227 eina_strbuf_free(sb);
228}
229
230//////////////////////////////////////////////////////////////////////////
231
232EOLIAN static void
233_efl_task_command_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *command)
234{
235 eina_stringshare_replace(&pd->command, command);
236 _clear_args(pd);
237 pd->args = _unescape(pd->command);
238}
239
240EOLIAN static const char *
241_efl_task_command_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
242{
243 _rebuild_command(pd);
244 return pd->command;
245}
246
247EOLIAN static unsigned int
248_efl_task_arg_count_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
249{
250 if (!pd->args) return 0;
251 return eina_array_count(pd->args);
252}
253
254EOLIAN static void
255_efl_task_arg_value_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, unsigned int num, const char *arg)
256{
257 const char *parg = NULL;
258 unsigned int count;
259
260 if (!pd->args) pd->args = eina_array_new(16);
261 count = eina_array_count(pd->args);
262 if ((count > 0) && (count > num))
263 parg = eina_array_data_get(pd->args, num);
264 else
265 {
266 unsigned int i;
267
268 for (i = count; i <= num; i++)
269 {
270 eina_array_push(pd->args, "");
271 eina_array_data_set(pd->args, i, NULL);
272 }
273 }
274
275 if (arg)
276 eina_array_data_set(pd->args, num, eina_stringshare_add(arg));
277 else
278 eina_array_data_set(pd->args, num, NULL);
279 if (parg) eina_stringshare_del(parg);
280 pd->command_dirty = EINA_TRUE;
281}
282
283EOLIAN static const char *
284_efl_task_arg_value_get(const Eo *obj EINA_UNUSED, Efl_Task_Data *pd, unsigned int num)
285{
286 unsigned int count;
287
288 if (!pd->args) return NULL;
289 count = eina_array_count(pd->args);
290 if (num >= count) return NULL;
291 return eina_array_data_get(pd->args, num);
292}
293
294EOLIAN static void
295_efl_task_arg_append(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, const char *arg)
296{
297 if (!pd->args) pd->args = eina_array_new(16);
298 if (arg)
299 eina_array_push(pd->args, eina_stringshare_add(arg));
300 else
301 eina_array_push(pd->args, NULL);
302 pd->command_dirty = EINA_TRUE;
303}
304
305EOLIAN static void
306_efl_task_arg_reset(Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
307{
308 _clear_args(pd);
309 pd->command_dirty = EINA_TRUE;
310}
311
312EOLIAN static void 15EOLIAN static void
313_efl_task_priority_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, Efl_Task_Priority priority) 16_efl_task_priority_set(Eo *obj EINA_UNUSED, Efl_Task_Data *pd, Efl_Task_Priority priority)
314{ 17{
@@ -344,7 +47,6 @@ _efl_task_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Task_Data *pd)
344{ 47{
345 eina_stringshare_del(pd->command); 48 eina_stringshare_del(pd->command);
346 pd->command = NULL; 49 pd->command = NULL;
347 _clear_args(pd);
348 efl_destructor(efl_super(obj, MY_CLASS)); 50 efl_destructor(efl_super(obj, MY_CLASS));
349} 51}
350 52
diff --git a/src/lib/ecore/efl_task.eo b/src/lib/ecore/efl_task.eo
index 526746ff60..ddab5e6826 100644
--- a/src/lib/ecore/efl_task.eo
+++ b/src/lib/ecore/efl_task.eo
@@ -19,83 +19,6 @@ abstract Efl.Task extends Efl.Object
19{ 19{
20 [[ ]] 20 [[ ]]
21 methods { 21 methods {
22 @property command {
23 [[ A commandline that encodes arguments in a command string.
24 This command is unix shell-style, thus whitespace separates
25 arguments unless escaped. Also a semi-colon ';', ampersand
26 '&', pipe/bar '|', hash '#', bracket, square brace, brace
27 character ('(', ')', '[', ']', '{', '}'), exclamation
28 mark '!', backquote '`', greator or less than ('>' '<')
29 character unless escaped or in quotes would cause
30 args_count/value to not be generated properly, because
31 it would force complex shell interpretation which
32 will not be supported in evaluating the arg_count/value
33 information, but the final shell may interpret this if this
34 is executed via a command-line shell. To not be a complex
35 shell command, it should be simple with paths, options
36 and variable expansions, but nothing more complex involving
37 the above unescaped characters.
38
39 "cat -option /path/file"
40 "cat 'quoted argument'"
41 "cat ~/path/escaped\ argument"
42 "/bin/cat escaped\ argument $VARIABLE"
43 etc.
44
45 It should not try and use "complex shell features" if you
46 want the arg_count and arg_value set to be correct after
47 setting the command string. For example none of:
48
49 "VAR=x /bin/command && /bin/othercommand >& /dev/null"
50 "VAR=x /bin/command `/bin/othercommand` | /bin/cmd2 && cmd3 &"
51 etc.
52
53 If you set the command the arg_count/value property contents
54 can change and be completely re-evaluated by parsing the
55 command string into an argument array set along with
56 interpreting escapes back into individual argument strings. ]]
57 get { }
58 set { }
59 values {
60 command: string; [[ The command string as described ]]
61 }
62 }
63 @property arg_count {
64 [[ Number of arguments passed in or arguments that are to be
65 passed as sepcified by arg_value ]]
66 get { }
67 values {
68 args: uint; [[ ]]
69 }
70 }
71 @property arg_value {
72 [[ Argument number by index. If the index does not exist when
73 set, it is allocated and created. Getting an argument that
74 Has not been set yet will return $NULL. Empty arguments will
75 Be ignored. Setting an argument will result in the command
76 porperty being re-evaluated and escaped into a single
77 command string if needed. ]]
78 set { }
79 get { }
80 keys {
81 num: uint; [[ ]]
82 }
83 values {
84 arg: string; [[ ]]
85 }
86 }
87 arg_append {
88 [[ Append a new string argument at the end of the arg set.
89 This functions like setting an arg_value at the end of the
90 current set so the set increases by 1 in size. ]]
91 params {
92 arg: string; [[ ]]
93 }
94 }
95 arg_reset {
96 [[ Clear all arguments in arg_value/count set. Will result in the
97 command property also being cleared. ]]
98 }
99 @property priority { 22 @property priority {
100 [[ The priority of this task. ]] 23 [[ The priority of this task. ]]
101 get { } 24 get { }
diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c
index 4d48296093..a324af4f58 100644
--- a/src/lib/ecore/efl_thread.c
+++ b/src/lib/ecore/efl_thread.c
@@ -25,10 +25,7 @@ typedef struct
25 int in, out; 25 int in, out;
26 Eo *in_handler, *out_handler; 26 Eo *in_handler, *out_handler;
27 } fd, ctrl; 27 } fd, ctrl;
28 struct { 28 Eina_Array *argv;
29 unsigned int argc;
30 const char **argv;
31 } args;
32 Efl_Callback_Array_Item_Full *event_cb; 29 Efl_Callback_Array_Item_Full *event_cb;
33 void *indata, *outdata; 30 void *indata, *outdata;
34} Thread_Data; 31} Thread_Data;
@@ -151,16 +148,16 @@ _efl_loop_arguments_send(Eo *obj, void *data EINA_UNUSED, const Eina_Value v)
151 Efl_Loop_Arguments arge; 148 Efl_Loop_Arguments arge;
152 Eina_Array *arga; 149 Eina_Array *arga;
153 Eina_Stringshare *s; 150 Eina_Stringshare *s;
154 unsigned int argc = efl_task_arg_count_get(obj); 151 Eina_Accessor *accessor;
155 unsigned int i; 152 const char *argv;
153 int i = 0;
156 154
157 arga = eina_array_new(argc); 155 accessor = efl_core_command_line_command_access(obj);
156 arga = eina_array_new(10);
158 157
159 for (i = 0; i < argc; i++) 158 EINA_ACCESSOR_FOREACH(accessor, i, argv)
160 { 159 {
161 const char *argv = efl_task_arg_value_get(obj, i); 160 eina_array_push(arga, eina_stringshare_add(argv));
162 if (argv)
163 eina_array_push(arga, eina_stringshare_add(argv));
164 } 161 }
165 arge.argv = arga; 162 arge.argv = arga;
166 arge.initialization = EINA_TRUE; 163 arge.initialization = EINA_TRUE;
@@ -229,7 +226,6 @@ _efl_thread_main(void *data, Eina_Thread t)
229 Eo *obj; 226 Eo *obj;
230 Eina_Value *ret; 227 Eina_Value *ret;
231 Control_Data cmd; 228 Control_Data cmd;
232 unsigned int i;
233 int real; 229 int real;
234 Efl_Callback_Array_Item_Full *it; 230 Efl_Callback_Array_Item_Full *it;
235 231
@@ -280,16 +276,13 @@ _efl_thread_main(void *data, Eina_Thread t)
280 efl_event_callback_priority_add(obj, it->desc, it->priority, 276 efl_event_callback_priority_add(obj, it->desc, it->priority,
281 it->func, it->user_data); 277 it->func, it->user_data);
282 } 278 }
283 for (i = 0; i < thdat->args.argc; i++) 279 efl_core_command_line_command_array_set(obj, thdat->argv);
284 efl_task_arg_append(obj, thdat->args.argv[i]);
285 efl_future_then(obj, efl_loop_job(obj), 280 efl_future_then(obj, efl_loop_job(obj),
286 .success = _efl_loop_arguments_send); 281 .success = _efl_loop_arguments_send);
287 282
288 for (i = 0; i < thdat->args.argc; i++) 283 while (thdat->argv && eina_array_count(thdat->argv)) free(eina_array_pop(thdat->argv));
289 eina_stringshare_del(thdat->args.argv[i]); 284 eina_array_free(thdat->argv);
290 free(thdat->args.argv);
291 free(thdat->event_cb); 285 free(thdat->event_cb);
292 thdat->args.argv = NULL;
293 thdat->event_cb = NULL; 286 thdat->event_cb = NULL;
294 287
295 ret = efl_loop_begin(obj); 288 ret = efl_loop_begin(obj);
@@ -575,7 +568,7 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
575 const char *name; 568 const char *name;
576 int pipe_to_thread[2]; 569 int pipe_to_thread[2];
577 int pipe_from_thread[2]; 570 int pipe_from_thread[2];
578 unsigned int argc, i, num; 571 unsigned int num;
579 Efl_Callback_Array_Item_Full *it; 572 Efl_Callback_Array_Item_Full *it;
580 Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS); 573 Efl_Task_Data *td = efl_data_scope_get(obj, EFL_TASK_CLASS);
581 574
@@ -729,24 +722,23 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
729 name = efl_name_get(obj); 722 name = efl_name_get(obj);
730 if (name) thdat->name = eina_stringshare_add(name); 723 if (name) thdat->name = eina_stringshare_add(name);
731 724
732 argc = efl_task_arg_count_get(obj); 725 {
733 if (argc > 0) 726 Eina_Accessor *acc;
734 { 727 int i = 0;
735 thdat->args.argc = argc; 728 const char *argv;
736 thdat->args.argv = malloc(argc * sizeof(char *)); 729
737 if (thdat->args.argv) 730 acc = efl_core_command_line_command_access(obj);
738 { 731 if (acc)
739 for (i = 0; i < argc; i++) 732 {
740 { 733 thdat->argv = eina_array_new(0);
741 const char *argv = efl_task_arg_value_get(obj, i); 734 EINA_ACCESSOR_FOREACH(acc, i, argv)
742 if (argv) 735 {
743 thdat->args.argv[i] = eina_stringshare_add(argv); 736 eina_array_push(thdat->argv, eina_stringshare_add(argv));
744 else 737 }
745 thdat->args.argv[i] = NULL; 738 }
746 } 739
747 } 740 }
748 // XXX: if malloc fails? 741
749 }
750 if (pd->event_cb) 742 if (pd->event_cb)
751 { 743 {
752 num = 0; 744 num = 0;
@@ -762,9 +754,8 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
762 754
763 if (!eina_thread_create(&(pd->thread), pri, -1, _efl_thread_main, thdat)) 755 if (!eina_thread_create(&(pd->thread), pri, -1, _efl_thread_main, thdat))
764 { 756 {
765 for (i = 0; i < thdat->args.argc; i++) 757 while (eina_array_count(thdat->argv)) eina_stringshare_del(eina_array_pop(thdat->argv));
766 eina_stringshare_del(thdat->args.argv[i]); 758 eina_array_free(thdat->argv);
767 free(thdat->args.argv);
768 efl_del(pd->fd.in_handler); 759 efl_del(pd->fd.in_handler);
769 efl_del(pd->fd.out_handler); 760 efl_del(pd->fd.out_handler);
770 efl_del(pd->ctrl.in_handler); 761 efl_del(pd->ctrl.in_handler);
diff --git a/src/lib/ecore/efl_thread.eo b/src/lib/ecore/efl_thread.eo
index 7837c7bfdb..02bf2f15df 100644
--- a/src/lib/ecore/efl_thread.eo
+++ b/src/lib/ecore/efl_thread.eo
@@ -1,4 +1,4 @@
1class Efl.Thread extends Efl.Task implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer 1class Efl.Thread extends Efl.Task implements Efl.ThreadIO, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line
2{ 2{
3 methods { 3 methods {
4 } 4 }
diff --git a/src/lib/ecore/meson.build b/src/lib/ecore/meson.build
index 375f745abd..2e44804481 100644
--- a/src/lib/ecore/meson.build
+++ b/src/lib/ecore/meson.build
@@ -181,6 +181,7 @@ ecore_src = [
181 'ecore_main_common.h', 181 'ecore_main_common.h',
182 'efl_exe.c', 182 'efl_exe.c',
183 'efl_thread.c', 183 'efl_thread.c',
184 'efl_appthread.c',
184 'efl_threadio.c', 185 'efl_threadio.c',
185 'efl_appthread.c', 186 'efl_appthread.c',
186 'efl_core_env.c', 187 'efl_core_env.c',