From 5d041cce13da66aa3457d236579a9ac90ebf7618 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 12 Oct 2024 20:54:07 +0200 Subject: fix constructor/destructor member visibility for component manager --- src/crepe/api/BehaviorScript.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/crepe/api') diff --git a/src/crepe/api/BehaviorScript.h b/src/crepe/api/BehaviorScript.h index e9542c1..ba60a8c 100644 --- a/src/crepe/api/BehaviorScript.h +++ b/src/crepe/api/BehaviorScript.h @@ -6,11 +6,14 @@ namespace crepe::api { class BehaviorScript : public Script, public Component { +protected: // only allow ComponentManager to instantiate scripts friend class ComponentManager; - -protected: BehaviorScript(); +public: + // but allow uniqe_ptr to call the destructor (THIS IS VERY IMPORTANT) + virtual ~BehaviorScript() = default; + }; } -- cgit v1.2.3