forked from enlightenment/efl
ecore/ecore_exe - Don't free the event data while we use it.
Since we are memcpying it to a new allocated memory, we can only free it after finishing doing that. SVN revision: 62970
This commit is contained in:
parent
1a1b9bc52b
commit
788f0c84e2
|
@ -915,19 +915,9 @@ ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
|
|||
count++;
|
||||
}
|
||||
}
|
||||
if (count == 0) /* No lines to send, cancel the event. */
|
||||
{
|
||||
_ecore_exe_event_exe_data_free(NULL, e);
|
||||
e = NULL;
|
||||
}
|
||||
else /* NULL terminate the array, so that people know where the end is. */
|
||||
{
|
||||
e->lines[count].line = NULL;
|
||||
e->lines[count].size = 0;
|
||||
}
|
||||
if (i > last) /* Partial line left over, save it for next time. */
|
||||
{
|
||||
if (e) e->size = last;
|
||||
if (count != 0) e->size = last;
|
||||
if (flags & ECORE_EXE_PIPE_READ)
|
||||
{
|
||||
exe->read_data_size = i - last;
|
||||
|
@ -941,6 +931,16 @@ ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
|
|||
memcpy(exe->error_data_buf, c, exe->error_data_size);
|
||||
}
|
||||
}
|
||||
if (count == 0) /* No lines to send, cancel the event. */
|
||||
{
|
||||
_ecore_exe_event_exe_data_free(NULL, e);
|
||||
e = NULL;
|
||||
}
|
||||
else /* NULL terminate the array, so that people know where the end is. */
|
||||
{
|
||||
e->lines[count].line = NULL;
|
||||
e->lines[count].size = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue