mirror of
https://github.com/derrod/legendary.git
synced 2025-01-10 14:25:28 +00:00
[models] Clear raw data in manifest after it has been read
Minor optimization to save some RAM, especially for JSON manifests.
This commit is contained in:
parent
7dacd7ba35
commit
c9392ca22c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue