Make the pipe closing work all of the time (so far), memory leak fixes.
This commit is contained in:
@@ -159,7 +159,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
burn_write_opts_free(opts);
|
||||
|
||||
printf("Disc now burning\n");
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_burn_progress_handler, NULL);
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_burn_progress_handler, proj);
|
||||
pthread_create(&progress_update, NULL, ecdb_drive_progress_update, proj);
|
||||
pthread_detach(progress_update);
|
||||
ECDB_PROJECT(proj)->ev_handler = ecore_event_handler_add
|
||||
@@ -201,9 +201,8 @@ ecdb_drive_progress_update(void *data)
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
ecore_pipe_write(proj->pipe, "AC", sizeof("AC"));
|
||||
ecore_pipe_del(proj->pipe);
|
||||
/* Call the finished event handler here */
|
||||
printf("Closing pipe\n");
|
||||
ecore_pipe_write(proj->pipe, proj->pipe, sizeof(Ecore_Pipe));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
@@ -214,12 +213,14 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
Evas_Object *swallow;
|
||||
static int last_sector = 0;
|
||||
int percent;
|
||||
Edje_Message_Int_Set *progress_msg = NULL;
|
||||
Edje_Message_Int_Set *progress_msg;
|
||||
Edje_Message_String finalize;
|
||||
|
||||
if ((nbyte != sizeof(BurnProgress)) || (!strcmp((char *)buffer, "AC")))
|
||||
printf("In progress handler, %d %d\n", sizeof(BurnProgress), nbyte);
|
||||
if (nbyte != sizeof(BurnProgress))
|
||||
{
|
||||
ecore_event_add(ECDB_DRIVE_ACTION_FINISHED, NULL, NULL, NULL);
|
||||
printf("Adding event to queue.\n");
|
||||
last_sector = 0;
|
||||
return;
|
||||
}
|
||||
@@ -285,6 +286,7 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
printf("Burn Complete\n");
|
||||
|
||||
ecore_event_handler_del(proj->proj->ev_handler);
|
||||
ecore_pipe_del(proj->proj->pipe);
|
||||
|
||||
switch (proj->proj->type)
|
||||
{
|
||||
|
Reference in New Issue
Block a user