added detach statements to prevent resource leak

This commit is contained in:
Paul Cruz 2017-08-01 17:36:13 -07:00
parent f8c7b191e7
commit 69ef22c0ac

View File

@ -785,6 +785,11 @@ static int performCompression(adaptCCtx* ctx, FILE* const srcFile, outputThreadA
signalErrorToThreads(ctx);
return 1;
}
else if (pthread_detach(out)) {
DISPLAY("Error: could not detach output thread\n");
signalErrorToThreads(ctx);
return 1;
}
}
/* create compression thread */
@ -795,6 +800,11 @@ static int performCompression(adaptCCtx* ctx, FILE* const srcFile, outputThreadA
signalErrorToThreads(ctx);
return 1;
}
else if (pthread_detach(compression)) {
DISPLAY("Error: could not detach compression thread\n");
signalErrorToThreads(ctx);
return 1;
}
}
{
unsigned currJob = 0;