Make the pipe closing work all of the time (so far), memory leak fixes.

This commit is contained in:
Jaime Thomas
2008-12-26 16:41:27 +00:00
parent 8f3f36891a
commit f90d42137c
4 changed files with 23 additions and 9 deletions

View File

@@ -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)
{