mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Fix #553
Ensure SourceMixin descendents shut down the source prior to closing. Furthermore, make sure devices are closed before pin factory shuts down, and that pins have a strong reference to their owning factory (to prevent losing the factory before the pins).
This commit is contained in:
@@ -70,10 +70,13 @@ class SourceMixin(object):
|
||||
|
||||
def close(self):
|
||||
try:
|
||||
super(SourceMixin, self).close()
|
||||
self.source = None
|
||||
except AttributeError:
|
||||
pass
|
||||
try:
|
||||
super(SourceMixin, self).close()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def _copy_values(self, source):
|
||||
for v in source:
|
||||
|
||||
Reference in New Issue
Block a user