mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-23 18:54:05 +01:00
Irc: explicitly kill connect loop threads after an Irc object has been removed
Possible fix for #351.
This commit is contained in:
parent
e977c95520
commit
6ad40c91b4
@ -180,6 +180,7 @@ class Irc():
|
|||||||
__init__ in a separate thread to allow multiple concurrent connections.
|
__init__ in a separate thread to allow multiple concurrent connections.
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
self.aborted.clear()
|
self.aborted.clear()
|
||||||
self.initVars()
|
self.initVars()
|
||||||
|
|
||||||
@ -326,6 +327,11 @@ class Irc():
|
|||||||
if autoconnect is not None and autoconnect >= 1:
|
if autoconnect is not None and autoconnect >= 1:
|
||||||
log.info('(%s) Going to auto-reconnect in %s seconds.', self.name, autoconnect)
|
log.info('(%s) Going to auto-reconnect in %s seconds.', self.name, autoconnect)
|
||||||
time.sleep(autoconnect)
|
time.sleep(autoconnect)
|
||||||
|
|
||||||
|
if self not in world.networkobjects.values():
|
||||||
|
log.debug('Stopping stale connect loop for old connection %r', self.name)
|
||||||
|
return
|
||||||
|
|
||||||
else:
|
else:
|
||||||
log.info('(%s) Stopping connect loop (autoconnect value %r is < 1).', self.name, autoconnect)
|
log.info('(%s) Stopping connect loop (autoconnect value %r is < 1).', self.name, autoconnect)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user