mirror of https://github.com/django/django.git
Loaded real destructor functions before garbage time
This is an alternative patch to the unsuccessful b43b27bcd
.
This commit is contained in:
parent
ad82d0003b
commit
60879a2193
|
@ -125,6 +125,11 @@ class IOBase(GEOSBase):
|
|||
def __init__(self):
|
||||
# Getting the pointer with the constructor.
|
||||
self.ptr = self._constructor()
|
||||
# Loading the real destructor function at this point as doing it in
|
||||
# __del__ is too late (import error).
|
||||
self._destructor.func = self._destructor.get_func(
|
||||
*self._destructor.args, **self._destructor.kwargs
|
||||
)
|
||||
|
||||
def __del__(self):
|
||||
# Cleaning up with the appropriate destructor.
|
||||
|
|
Loading…
Reference in New Issue