From da379a58033c0ef3c9c854326a3fca25d6e54319 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 20 Nov 2024 22:18:54 +0100 Subject: add Script::subscribe --- src/crepe/api/Script.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/crepe/api/Script.cpp (limited to 'src/crepe/api/Script.cpp') diff --git a/src/crepe/api/Script.cpp b/src/crepe/api/Script.cpp new file mode 100644 index 0000000..9ebb074 --- /dev/null +++ b/src/crepe/api/Script.cpp @@ -0,0 +1,11 @@ +#include "Script.h" + +using namespace crepe; + +Script::~Script() { + EventManager & evmgr = *this->event_manager_ref; + for (auto id : this->listeners) { + evmgr.unsubscribe(id); + } +} + -- cgit v1.2.3