diff --git a/legendary/models/json_manifest.py b/legendary/models/json_manifest.py index b86b3dd..d5a13b3 100644 --- a/legendary/models/json_manifest.py +++ b/legendary/models/json_manifest.py @@ -53,6 +53,10 @@ class JSONManifest(Manifest): if _tmp.keys(): print(f'Did not read JSON keys: {_tmp.keys()}!') + # clear raw data after manifest has been loaded + _m.data = b'' + _m.json_data = None + return _m @classmethod diff --git a/legendary/models/manifest.py b/legendary/models/manifest.py index 3957217..7cc6ca9 100644 --- a/legendary/models/manifest.py +++ b/legendary/models/manifest.py @@ -80,6 +80,11 @@ class Manifest: logger.warning(f'Did not read {len(unhandled_data)} remaining bytes in manifest! ' f'This may not be a problem.') + # Throw this away since the raw data is no longer needed + _tmp.close() + del _tmp + _m.data = b'' + return _m @classmethod