Skip to content

Commit

Permalink
Minor code cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed May 29, 2024
1 parent c0889a5 commit c10e400
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lupa/_lupa.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ cdef class LuaRuntime:
if self._pending_unrefs is None or self._state is NULL:
return 0

cdef int ref
L = self._state
pending_unrefs = self._pending_unrefs
self._pending_unrefs = None

cdef int ref
L = self._state
for ref in pending_unrefs:
lua.luaL_unref(L, lua.LUA_REGISTRYINDEX, ref)
print(f"Cleaned up {len(pending_unrefs)} Lua refs") # TODO: remove
Expand Down Expand Up @@ -1367,7 +1368,7 @@ cdef class _LuaIter:
runtime = self._runtime
self._runtime = None
ref = self._refiter
if self._refiter == lua.LUA_NOREF:
if ref == lua.LUA_NOREF:
return
self._refiter = lua.LUA_NOREF
cdef lua_State* L = self._state
Expand Down

0 comments on commit c10e400

Please sign in to comment.