Move the cleanup() function from Onionshare class to Web class, so that the list of files to be cleaned up is always available (needed for website temp files)

This commit is contained in:
Miguel Jacq 2021-05-04 16:21:42 +10:00
parent e48b300ff9
commit ff5e73a2ae
10 changed files with 40 additions and 38 deletions

View file

@ -497,7 +497,7 @@ class ShareModeWeb(SendBaseModeWeb):
self.gzip_etag = make_etag(f)
# Make sure the gzip file gets cleaned up when onionshare stops
self.cleanup_filenames.append(self.gzip_filename)
self.web.cleanup_filenames.append(self.gzip_filename)
self.is_zipped = False
@ -524,7 +524,7 @@ class ShareModeWeb(SendBaseModeWeb):
self.download_etag = make_etag(f)
# Make sure the zip file gets cleaned up when onionshare stops
self.cleanup_filenames.append(self.zip_writer.zip_filename)
self.web.cleanup_filenames.append(self.zip_writer.zip_filename)
self.is_zipped = True