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 authored and Brandon Philips committed Aug 14, 2012
1 parent c4570f3 commit 14e55fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/luvit/uv.lua
Expand Up @@ -21,6 +21,12 @@ objects.
local Handle = Emitter:extend()
uv.Handle = Handle

function Handle:initialize()
self:on('closed', function()
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 14e55fb

Please sign in to comment.