mpc.lua: Call reply handler at a later point
This calls a quite arbitrary callback which could cause an error. Thus, only call it when everything else is done. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
a0898fc6b7
commit
1c52a20221
|
@ -95,9 +95,10 @@ function mpc:_connect()
|
|||
else
|
||||
arg = { line }
|
||||
end
|
||||
self._reply_handlers[1](success, arg)
|
||||
local handler = self._reply_handlers[1]
|
||||
table.remove(self._reply_handlers, 1)
|
||||
self._pending_reply = {}
|
||||
handler(success, arg)
|
||||
else
|
||||
local _, _, key, value = string.find(line, "([^:]+):%s(.+)")
|
||||
if key then
|
||||
|
|
Loading…
Reference in New Issue