std::unique_ptr<coco::PtrLink<coco::Block, coco::Module>> _block_link;
public:
- std::unique_ptr<coco::EntityManager> _entity;
-
-public:
coco::EntityManager *entity(void) override { return _entity.get(); }
const coco::EntityManager *entity(void) const override { return _entity.get(); }
public:
coco::OutputList *output(void) override { return _output.get(); }
const coco::OutputList *output(void) const override { return _output.get(); }
+
+public:
+ // WARN _entity SHOULD BE declared after _block in order to allow each Block(s) to detach itself.
+ //
+ // If not, Block is destructed after its corresponding BlockList is destructed, which results
+ // in invalid memory access during the update on BlockList (inside Block's destructor).
+ std::unique_ptr<coco::EntityManager> _entity;
};
} // namespace