Skip to content

Commit

Permalink
Ensure Document and Location models are collected
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 12, 2020
1 parent d4375db commit 248a993
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions panel/viewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,16 @@ def _cleanup(self, root):
root: bokeh.model.Model
Bokeh model for the view being cleaned up
"""
if root.ref['id'] in state._handles:
del state._handles[root.ref['id']]
if root.document in state._locations:
del state._locations[root.document]
ref = root.ref['id']
if ref in state._handles:
del state._handles[ref]
if ref in state._views:
doc = state._views[ref][2]
del state._views[ref]
if doc in state._locations:
loc = state._locations[doc]
loc._cleanup(root)
del state._locations[doc]

def _preprocess(self, root):
"""
Expand Down

0 comments on commit 248a993

Please sign in to comment.