forked from lix-project/lix
Cleanup
This commit is contained in:
parent
3a778ea8a0
commit
5176b072ed
|
@ -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