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

BUG: Fix memory leak in CRS.list_authority #1178

Merged
merged 1 commit into from Nov 13, 2022
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/history.rst
Expand Up @@ -8,6 +8,7 @@ Latest
-----
- BUG: Changed so that the setup.cfg depends on the version code in the __init__.py instead of the other way around (issuue #1155)
- BUG: Fix :meth:`.CRS.to_cf` for Pole rotation GRIB convention (pull #1167)
- BUG: Fix :meth:`.CRS.to_authority` memory leak (pull #1178)
- REF: Use upper case EPSG code when creating CRS (pull #1162)

3.4.0
Expand Down
8 changes: 6 additions & 2 deletions pyproj/_crs.pyx
Expand Up @@ -2883,9 +2883,13 @@ cdef class _CRS(Base):
out_confidence_list[iii]
)
)
# at this point, the auth name is copied and we can release the proj object
proj_destroy(proj)
proj = NULL
finally:
for iii in range(num_proj_objects):
skogler marked this conversation as resolved.
Show resolved Hide resolved
proj_destroy(proj_list_get(self.context, proj_list, iii))
# If there was an error we have to call proj_destroy
# If there was none, calling it on NULL does nothing
proj_destroy(proj)
proj_list_destroy(proj_list)
CRSError.clear()
return authority_list
Expand Down