diff --git a/lupa/_lupa.pyx b/lupa/_lupa.pyx index ad539e68..92f2191e 100644 --- a/lupa/_lupa.pyx +++ b/lupa/_lupa.pyx @@ -2544,6 +2544,7 @@ cdef int byte_writer(lua_State* L, void* new_data, size_t new_size, void* desc) bd.data = data bd.length = bd.length + new_size else: + bd.length = 0 free(data) return 1 return 0 \ No newline at end of file diff --git a/lupa/luaapi.pxd b/lupa/luaapi.pxd index 9fd70792..58f956f7 100644 --- a/lupa/luaapi.pxd +++ b/lupa/luaapi.pxd @@ -273,22 +273,18 @@ cdef extern from "lua.h" nogil: cdef extern from "lstate.h" nogil: cppclass Proto: pass - ctypedef Proto Proto ctypedef struct LClosure: Proto* p union Closure: LClosure l - ctypedef Closure Closure union GCObject: Closure cl - ctypedef GCObject GCObject union Value: GCObject* gc - ctypedef Value Value ctypedef struct lua_TValue: Value value