Skip to content

Commit

Permalink
luvit: uv: Handle: set _closed when closed received
Browse files Browse the repository at this point in the history
internally on errors luvit may close a handle. Ensure we don't double
close and cause an assert by setting self._closed on the closed signal.
  • Loading branch information
philips committed Aug 9, 2012
1 parent 76809b3 commit 33d4334
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/luvit/uv.lua
Expand Up @@ -21,6 +21,13 @@ objects.
local Handle = Emitter:extend()
uv.Handle = Handle

function Handle:initialize()
self:on('closed', function()
p("handle closed internally")
self._closed = true
end)
end

-- Wrapper around `uv_close`. Closes the underlying file descriptor of a handle.
-- Handle:close()
Handle.close = function(self)
Expand Down

0 comments on commit 33d4334

Please sign in to comment.