cschreib / lxgui

Portable, real time, modular and data-driven GUI C++ library.
https://cschreib.github.io/lxgui
MIT License
75 stars 20 forks source link

Use `observable_unique_ptr` and its observer pointer #79

Closed cschreib closed 2 years ago

cschreib commented 3 years ago

Currently we rely on std::unique_ptr<T> for ownership, and T* for observer pointers. We have to do some convoluted logic to handle or avoid using dangling pointers (including this with alive_checker). This could be resolved by replacing this combo of pointers by observable_sealed_ptr<T> and observer_ptr<T> from https://github.com/cschreib/observable_unique_ptr