mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
PyLinkNetworkCore: copy world.hooks before iterating
This fixes a race condition where the order of PRIVMSG handlers could be changed as 'load <plugin>' runs, causing the load command to be processed multiple times.
This commit is contained in:
parent
2535aa145f
commit
113bfcba9d
@ -233,7 +233,7 @@ class PyLinkNetworkCore(structures.DeprecatedAttributesObject, structures.CamelC
|
||||
command, hook_cmd)
|
||||
|
||||
# Iterate over registered hook functions, catching errors accordingly.
|
||||
for hook_pair in world.hooks[hook_cmd]:
|
||||
for hook_pair in world.hooks[hook_cmd].copy():
|
||||
hook_func = hook_pair[1]
|
||||
try:
|
||||
log.debug('(%s) Calling hook function %s from plugin "%s"', self.name,
|
||||
|
Loading…
Reference in New Issue
Block a user