Commit 60879a21 authored by Claude Paroz's avatar Claude Paroz
Browse files

Loaded real destructor functions before garbage time

This is an alternative patch to the unsuccessful b43b27bc.
parent ad82d000
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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.