mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 20:41:57 +00:00
Merge pull request #783 from jerson/patch-1
Fixed fireOnLeave when connection is already closed Former-commit-id: 6af5403ac3adceed1017f886a1b7cb336495d125
This commit is contained in:
@@ -477,6 +477,10 @@ func (c *connection) OnLeave(roomLeaveCb LeaveRoomFunc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *connection) fireOnLeave(roomName string) {
|
func (c *connection) fireOnLeave(roomName string) {
|
||||||
|
// check if connection is already closed
|
||||||
|
if c == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
// fire the onRoomLeaveListeners
|
// fire the onRoomLeaveListeners
|
||||||
for i := range c.onRoomLeaveListeners {
|
for i := range c.onRoomLeaveListeners {
|
||||||
c.onRoomLeaveListeners[i](roomName)
|
c.onRoomLeaveListeners[i](roomName)
|
||||||
|
|||||||
Reference in New Issue
Block a user