mirror of
https://github.com/facebook/zstd.git
synced 2025-11-27 00:05:09 -05:00
added detach statements to prevent resource leak
This commit is contained in:
parent
f8c7b191e7
commit
69ef22c0ac
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user