Skip to content

Commit

Permalink
JumpList.cpp: Avoid crashes on App-V. refs #2548: Crash on opening 2 …
Browse files Browse the repository at this point in the history
…files via drag & drop
  • Loading branch information
sdottaka committed Nov 21, 2024
1 parent f1741e3 commit 8313dcb
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Src/JumpList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,21 @@ bool SetCurrentProcessExplicitAppUserModelID(const std::wstring& appid)

bool AddToRecentDocs(const String& app_path, const String& params, const String& title, const String& desc, const String& icon_path, int icon_index)
{
SHARDAPPIDINFOLINK saiil;
saiil.pszAppID = g_appid.c_str();
saiil.psl = CreateShellLink(app_path, params, title, desc, icon_path, icon_index);
if (saiil.psl == nullptr)
__try
{
SHARDAPPIDINFOLINK saiil;
saiil.pszAppID = g_appid.c_str();
saiil.psl = CreateShellLink(app_path, params, title, desc, icon_path, icon_index);
if (saiil.psl == nullptr)
return false;
SHAddToRecentDocs(SHARD_APPIDINFOLINK, &saiil);
saiil.psl->Release();
return true;
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
SHAddToRecentDocs(SHARD_APPIDINFOLINK, &saiil);
saiil.psl->Release();
return true;
}
}

std::vector<Item> GetRecentDocs(size_t nMaxItems)
Expand Down

0 comments on commit 8313dcb

Please sign in to comment.