mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-12-01 18:16:14 +02:00
Cleanup
This commit is contained in:
parent
3a778ea8a0
commit
5176b072ed
1 changed files with 1 additions and 9 deletions
|
@ -725,16 +725,8 @@ ref<FileTransfer> getFileTransfer()
|
||||||
{
|
{
|
||||||
static ref<curlFileTransfer> fileTransfer = makeCurlFileTransfer();
|
static ref<curlFileTransfer> fileTransfer = makeCurlFileTransfer();
|
||||||
|
|
||||||
// this has to be done in its own scope to make sure that the lock is released
|
if (fileTransfer->state_.lock()->quit)
|
||||||
// before creating a new fileTransfer instance.
|
|
||||||
auto needsRecreation = [&]() -> bool {
|
|
||||||
auto state = fileTransfer->state_.lock();
|
|
||||||
return state->quit;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (needsRecreation()) {
|
|
||||||
fileTransfer = makeCurlFileTransfer();
|
fileTransfer = makeCurlFileTransfer();
|
||||||
}
|
|
||||||
|
|
||||||
return fileTransfer;
|
return fileTransfer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue