Skip to content

Commit

Permalink
Merge branch 'graceful_exit' into graceful_exit_part2
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkautarch committed Dec 7, 2024
2 parents 7860a0b + 1cc785b commit 04a6b96
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/steamcompmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5902,6 +5902,23 @@ using XwlLock = gamescope::ReferencedLock<s_xwlLockReference>;
[[noreturn]] static void
steamcompmgr_exit(std::optional<std::unique_lock<std::mutex>> lock = std::nullopt)
{

// Need to clear all the vk_lutxd references (which can be tied to backend-allocated memory)
// for the colormgmt globals/statics, to avoid coredump at exit from within the colormgmt exit-time destructors:
for (auto& colorMgmtArr :
{
std::ref(g_ColorMgmtLuts),
std::ref(g_ColorMgmtLutsOverride),
std::ref(g_ScreenshotColorMgmtLuts),
std::ref(g_ScreenshotColorMgmtLutsHDR)
})
{
for (auto& colorMgmt : colorMgmtArr.get())
{
colorMgmt.gamescope_color_mgmt_luts::~gamescope_color_mgmt_luts(); //dtor call also calls all the subobjects' dtors
}
}

g_ImageWaiter.Shutdown();

// Clean up any commits.
Expand All @@ -5926,7 +5943,7 @@ steamcompmgr_exit(std::optional<std::unique_lock<std::mutex>> lock = std::nullop
{
g_ColorMgmt.pending.appHDRMetadata = nullptr;
g_ColorMgmt.current.appHDRMetadata = nullptr;

g_ColorMgmt.gamescope_color_mgmt_tracker_t::~gamescope_color_mgmt_tracker_t();
s_scRGB709To2020Matrix = nullptr;
for (int i = 0; i < gamescope::GAMESCOPE_SCREEN_TYPE_COUNT; i++)
{
Expand Down

0 comments on commit 04a6b96

Please sign in to comment.