Close the protobuf session on shutdown

This commit is contained in:
Lee Bousfield 2023-04-23 22:01:25 -06:00
parent 242db96937
commit e691f8de10
No known key found for this signature in database
GPG Key ID: 51137D1C9B477CBD
3 changed files with 8 additions and 0 deletions

View File

@ -143,5 +143,9 @@ class FlipperAPI():
with self.mutex:
self._cmd_storage_write(path, data)
def close(self):
with self.mutex:
self.proto.cmd_flipper_stop_session()
class InvalidNameError(RuntimeError):
pass

View File

@ -189,3 +189,6 @@ class FlipperZeroFileSystem(fuse.Operations, fuse.LoggingMixIn):
cached = self.get_file_by_path(path)
self.api.delete(path, True)
cached['parent']['children'].remove(cached)
def close(self):
self.api.close()

View File

@ -55,6 +55,7 @@ def main():
fuse.FUSE(backend, args.mountpoint, foreground=True)
print('fuse stopped')
backend.close()
flsrl.close()
if __name__ == '__main__':