Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion inkcpp/globals_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ class globals_impl final
// Initializes a new global store from the given story
globals_impl(const story_impl*);

virtual ~globals_impl() {}
virtual ~globals_impl()
{
for (const auto& callback : _callbacks) {
delete callback.operation;
}
}

snapshot* create_snapshot() const override;

Expand Down
5 changes: 3 additions & 2 deletions inkcpp/include/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class callback_base
{
public:
virtual void call(ink::runtime::value, ink::optional<ink::runtime::value>) = 0;
virtual ~callback_base() = default;
};

template<typename F>
Expand Down Expand Up @@ -313,8 +314,8 @@ class function_array_delegate : public function_base
char* ptr = buffer;
while (*src != '\0')
*(ptr++) = *(src++);
*ptr = 0;
result = ink::runtime::value(buffer);
*ptr = 0;
result = ink::runtime::value(buffer);
}
push(stack, result);
}
Expand Down