Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed one memory leak in complex objects #537

Merged
merged 1 commit into from Jan 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/uproot/model.py
Expand Up @@ -1172,7 +1172,10 @@ def class_of_version(cls, version):
If not, this classmethod returns None. No attempt is made to create a
missing class.
"""
return cls.known_versions.get(version)
out = cls.known_versions.get(version)
if out is None and version == 0 and len(cls.known_versions) != 0:
out = cls.known_versions[max(cls.known_versions)]
return out

@classmethod
def has_version(cls, version):
Expand Down Expand Up @@ -1267,7 +1270,7 @@ def read(cls, chunk, cursor, context, file, selffile, parent, concrete=None):
is_memberwise,
) = uproot.deserialization.numbytes_version(chunk, cursor, context, move=False)

versioned_cls = cls.known_versions.get(version)
versioned_cls = cls.class_of_version(version)

if versioned_cls is not None:
pass
Expand Down