mirror of
https://github.com/django/django.git
synced 2025-11-23 12:26:57 +00:00
Fixed #25657 -- Ignored exceptions when destroying geometry objects
Due to randomness of garbage collection with geometry objects, it's easier to simply ignore AttributeError/TypeError generally raised when parts of objects are already garbage-collected. Thanks Sergey Fedoseev and Tim Graham for reviewing the patch.
This commit is contained in:
parent
ec708803f7
commit
cd40d9e721
8 changed files with 27 additions and 9 deletions
|
|
@ -121,8 +121,10 @@ class OGRGeometry(GDALBase):
|
|||
|
||||
def __del__(self):
|
||||
"Deletes this Geometry."
|
||||
if self._ptr and capi:
|
||||
try:
|
||||
capi.destroy_geom(self._ptr)
|
||||
except (AttributeError, TypeError):
|
||||
pass # Some part might already have been garbage collected
|
||||
|
||||
# Pickle routines
|
||||
def __getstate__(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue