Fix crash when ui used (#97)
* one way to fix lambda, probably not the best tho * also fix RemovePackageAsync even though that isn't called by anything yet
This commit is contained in:
Родитель
af7ba4ac90
Коммит
3f068a35b0
|
@ -26,11 +26,11 @@ shared_ptr<IMsixResponse> PackageManager::AddPackageAsync(const wstring & packag
|
|||
impl->GetMsixResponse()->SetCallback(callback);
|
||||
}
|
||||
|
||||
auto t = thread([&impl]() {
|
||||
impl->ProcessRequest();
|
||||
delete impl;
|
||||
impl = nullptr;
|
||||
});
|
||||
auto t = thread([&](MsixRequest* msixRequest) {
|
||||
msixRequest->ProcessRequest();
|
||||
delete msixRequest;
|
||||
msixRequest = nullptr;
|
||||
}, impl);
|
||||
t.detach();
|
||||
return impl->GetMsixResponse();
|
||||
}
|
||||
|
@ -60,10 +60,11 @@ shared_ptr<IMsixResponse> PackageManager::RemovePackageAsync(const wstring & pac
|
|||
impl->GetMsixResponse()->SetCallback(callback);
|
||||
}
|
||||
|
||||
thread t([&impl]() {
|
||||
impl->ProcessRequest();
|
||||
impl = nullptr;
|
||||
});
|
||||
auto t = thread([&](MsixRequest* msixRequest) {
|
||||
msixRequest->ProcessRequest();
|
||||
delete msixRequest;
|
||||
msixRequest = nullptr;
|
||||
}, impl);
|
||||
t.detach();
|
||||
return impl->GetMsixResponse();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче