Skip to content

Refactor asset management to use shared_ptr#870

Merged
PointerDilemma merged 3 commits intohyprwm:mainfrom
davc0n:shared-pointers
Sep 15, 2025
Merged

Refactor asset management to use shared_ptr#870
PointerDilemma merged 3 commits intohyprwm:mainfrom
davc0n:shared-pointers

Conversation

@davc0n
Copy link
Contributor

@davc0n davc0n commented Sep 11, 2025

ref. #811

Copy link
Collaborator

@PointerDilemma PointerDilemma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!
We moved to Hyprutils::Memory::CAtomicSharedPointer a while ago. (Used as ASP and AWP).
Can you migrate this to it? Should be rather easy to do. Looks good otherwise.

One thing we need to be careful with now is that the destructor of SPreloadedAsset is not called with unloadAsset anymore. That means storing asset SP in widget good. Storing asset SP somewhere else bad. Then everything will be cleaned up nicely when removing a widget.

Sidenote: This made me wonder if some of the monitor reconnect crashes could be due background assets that we intentionally keep loaded. Could be that once all monitors are gone the buffers are somehow not valid anymore. This actually might be it

@PointerDilemma
Copy link
Collaborator

Thanks! We will migrate to hyprwm/hyprgraphics#36 soon, but doesn't hurt to move to SPs before that :)

@PointerDilemma PointerDilemma merged commit a7f2634 into hyprwm:main Sep 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants