Add warning if skill isn't properly removed
parent
3be861cee2
commit
34a527b130
|
@ -240,6 +240,14 @@ def _watch_skills():
|
||||||
logger.debug("Reloading Skill: " + skill_folder)
|
logger.debug("Reloading Skill: " + skill_folder)
|
||||||
# removing listeners and stopping threads
|
# removing listeners and stopping threads
|
||||||
skill["instance"].shutdown()
|
skill["instance"].shutdown()
|
||||||
|
|
||||||
|
# - 2 since there are two local references that are known
|
||||||
|
refs = sys.getrefcount(skill["instance"]) - 2
|
||||||
|
if refs > 0:
|
||||||
|
logger.warn("After shutdown of {} there are still "
|
||||||
|
"{} references remaining. The skill "
|
||||||
|
"won't be cleaned from memory."
|
||||||
|
.format(skill['instance'].name, refs))
|
||||||
del skill["instance"]
|
del skill["instance"]
|
||||||
skill["loaded"] = True
|
skill["loaded"] = True
|
||||||
skill["instance"] = load_skill(
|
skill["instance"] = load_skill(
|
||||||
|
|
Loading…
Reference in New Issue