Original Post
Hi everyone, I ve been pulling my air for awhile on this issue, I want a remove ownership destruction from Luabind, and manage my own garbage via C++; The doc says: Adopt: Used to transfer ownership across language boundaries. index The index which should transfer ownership, _N or result Here is what I do:
.cpp
class_<Object>("Object")
.def(constructor<>(), adopt(result))
.lua
myObject = Object();
luabind/src/object_rep.hpp
but when lua_close() is called, it still want to delete its pointer:
template<class T>
struct delete_s
{
static void apply(void* ptr)
{
delete static_cast<T*>(ptr); <<<<<< goes here!
}
};
What did I missed? [Edited by - golgoth13 on February 25, 2009 5:04:26 PM]