mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
settings observers lifecycle
This commit is contained in:
parent
201209887f
commit
5b82b18c6f
6 changed files with 75 additions and 43 deletions
19
src/util/ObjectsKeeper.hpp
Normal file
19
src/util/ObjectsKeeper.hpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef UTIL_OBJECTS_KEEPER_HPP_
|
||||
#define UTIL_OBJECTS_KEEPER_HPP_
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace util {
|
||||
class ObjectsKeeper {
|
||||
std::vector<std::shared_ptr<void>> ptrs;
|
||||
public:
|
||||
virtual ~ObjectsKeeper() {}
|
||||
|
||||
virtual void keepAlive(std::shared_ptr<void> ptr) {
|
||||
ptrs.push_back(ptr);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // UTIL_OBJECTS_KEEPER_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue