mirror of
https://github.com/facebook/zstd.git
synced 2026-01-06 11:21:19 +03:00
added detach statements to prevent resource leak
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user