Fix. crash when using EventCounsumer.ievents iterator. (#2865)

Problem code is
``` Lua
for event in ievents{'SHUTDOWN','CUSTOM::event'} do
end
```
This commit is contained in:
Alexey Melnichuk 2017-10-06 21:36:23 +03:00 committed by FusionPBX
parent 15b98a2f0a
commit 41083c7a8c
1 changed files with 6 additions and 6 deletions

View File

@ -375,7 +375,7 @@ end
function TimeEvents:fire(this, ...)
self._lock = true
local i, events = 0, self._events
local events = self._events
for i = 1, #events do
local event = events[i]
if event:rest() == 0 then
@ -609,9 +609,9 @@ local ievents = function(events, block, timeout)
for _, event in ipairs(array) do
local name, class
if type(event) == 'table' then
base, sub = event[1], event[2]
name, class = event[1], event[2]
else
name, class = split_event(base)
name, class = split_event(event)
end
if not class then events:bind(name)
else events:bind(name, class) end