Skip to content

Commit

Permalink
protect asyncInstall lifecycle
Browse files Browse the repository at this point in the history
RequestVettingStation can complete and take down its PresetsInstallTask
if the required subforkit is already available

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7b2ec831158022e904bb28223053150543a2a241
  • Loading branch information
caolanm committed Feb 27, 2025
1 parent 455defb commit db0d649
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wsd/DocumentBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1501,8 +1501,12 @@ DocumentBroker::updateSessionWithWopiInfo(const std::shared_ptr<ClientSession>&
void PresetsInstallTask::asyncInstall(const std::string& uri, const std::string& stamp, const std::string& fileName,
const std::shared_ptr<ClientSession>& session)
{
auto presetInstallFinished = [this](const std::string& id, bool presetResult)
auto presetInstallFinished = [selfWeak = weak_from_this(), this](const std::string& id, bool presetResult)
{
std::shared_ptr<PresetsInstallTask> selfLifecycle = selfWeak.lock();
if (!selfLifecycle)
return;

installPresetFinished(id, presetResult);
};

Expand Down

0 comments on commit db0d649

Please sign in to comment.