Skip to content

Commit

Permalink
bugfix: double check in SUB
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Apr 30, 2014
1 parent 5d0da82 commit 9033c5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions service/multicastd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ function command.SUB(source, c)
if skynet.call(node_address[node], "lua", "SUBR", c) then
return
end
channel[c] = {}
channel_n[c] = 0
if channel[c] == nil then
-- double check, because skynet.call whould yield, other SUB may occur.
channel[c] = {}
channel_n[c] = 0
end
end
end
local group = channel[c]
Expand Down

0 comments on commit 9033c5c

Please sign in to comment.