Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/napari_imagej/widgets/napari_imagej.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,15 @@ def return_search_bar():
# Start constructing the ImageJ instance
self.ij_initializer.start()

# Ensure widget closes when JVM closes
# Without this call we are prone to segfaults during JVM shutdown
when_jvm_stops(self.close)

def close(self):
# Ensure setup completed
self.wait_for_finalization()
# Close things down
super().close()
self.ij_initializer._clean_subscribers()

def wait_for_finalization(self):
Expand Down
Loading