Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/JABWrapper/jab_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
create_unicode_buffer
)

from _ctypes import FreeLibrary

from typing import Callable, List, Tuple

from JABWrapper.jab_types import (
Expand Down Expand Up @@ -195,9 +197,14 @@ def _init(self) -> None:
self._context_callbacks: dict[str, List[Callable[[JavaObject], None]]] = dict()

def shutdown(self):
# Call at the end to execution to free memory and unload the
# windows wrapper.dll
self._context_callbacks = dict()
if not self.ignore_callbacks:
self._remove_callbacks()
if self._wab and self._wab._handle:
FreeLibrary(self._wab._handle)
del self._wab

def _define_functions(self) -> None:
# void Windows_run()
Expand Down