Refactor asset management to use shared_ptr#870
Refactor asset management to use shared_ptr#870PointerDilemma merged 3 commits intohyprwm:mainfrom davc0n:shared-pointers
Conversation
PointerDilemma
left a comment
There was a problem hiding this comment.
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
|
Thanks! We will migrate to hyprwm/hyprgraphics#36 soon, but doesn't hurt to move to SPs before that :) |
ref. #811