Add Handle class.

This commit is contained in:
King_DuckZ 2020-04-28 14:25:35 +02:00
commit 79f59f5d36
5 changed files with 49 additions and 0 deletions

View file

@ -164,6 +164,11 @@ namespace wren {
return interpret(module_name.c_str(), script.c_str());
}
void VM::release (Handle& handle) noexcept {
if (handle)
wrenReleaseHandle(m_local->wvm, handle);
}
template <typename T>
T VM::slot (int slot_num) {
return slot_specialized<T>(m_local->wvm, slot_num);