I have this code:
MountedJob* new_MountedJob(Job** job){
MountedJob* new = malloc(sizeof(MountedJob*));
printf("ok ");
new->job = *job;
printf("not ok");
new->neededTools = new->job->toolSet;
new->baseInstance = new->job->baseInstance;
new->cj = new->baseInstance->C - hashset_size(new->neededTools);
hashset_new(&new->unneededTools);
return new;
}
It is executed 10 times, each time for a Job passed as an argument. They come from a iterated list and are generated exactly the same way. At the 3rd iteration, new->job = *job;
crashes with access violation error code (0xc0000005). The problem is that it works just fine in debug mode so I have no clue what the problem could be. Especially that it works for the 2 first iterations, that's unconsistent I really don't understand.
Thank you.