diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -191,6 +191,7 @@ void prepare_distrenjob(struct distrenjo int counter; struct distrenjob *distrenjob; + distrenjob_new(&distrenjob); distrenjob->type = 1; distrenjob->name = name; @@ -198,17 +199,6 @@ void prepare_distrenjob(struct distrenjo distrenjob->email = email; distrenjob->priority = priority; distrenjob->total_frames = (end_frame - start_frame + 1); // sets the total number of frames in animation for status purposes - distrenjob->frameset = malloc(distrenjob->total_frames); - - distrenjob->assigned_frames = 0; - distrenjob->completed_frames = 0; - - /* @TODO: should the aove be malloc(sizeof(struct frameset) * distrenjob->total_frames? */ - /* - distrenjob->frameset = malloc(sizeof(struct frameset) * numframes); - if(!job->frameset) - fprintf(stderr, "Error allocating memory\n"); - */ /* prepares all the frames by setting that status to "unassigned" */ counter2 = start_frame; @@ -219,6 +209,7 @@ void prepare_distrenjob(struct distrenjo counter2++; } + /* add job to queue */ distrenjob_enqueue(head, distrenjob); general_info.jobs_in_queue++;