Skip to content

Commit

Permalink
plot3d (octarine): correctly detect closed viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Sep 15, 2024
1 parent 9b783c9 commit 236f9c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions navis/plotting/ddd.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,12 @@ def plot3d_octarine(x, **kwargs):
# Check if any existing viewer has already been closed
if isinstance(getattr(config, "primary_viewer", None), oc.Viewer):
try:
_ = getattr(config, "primary_viewer").canvas
getattr(config, "primary_viewer").canvas.__repr__()
except RuntimeError:
config.primary_viewer = None

if settings.viewer in (None, "new"):
# If it does not exists yet, initialise a canvas object and make global
# If it does not exists yet, initialize a canvas object and make global
if (
not isinstance(getattr(config, "primary_viewer", None), oc.Viewer)
or settings.viewer == "new"
Expand Down

0 comments on commit 236f9c6

Please sign in to comment.