Skip to content

Commit

Permalink
fix(WidgetManager): Guard against object deletion
Browse files Browse the repository at this point in the history
WidgetManager may be deleted between updateSvg() and the promise
resolution callback.
  • Loading branch information
floryst committed Apr 6, 2020
1 parent bb17297 commit d22b8b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Widgets/Core/WidgetManager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ function vtkWidgetManager(publicAPI, model) {
}

Promise.all(pendingContent).then((vnodes) => {
if (model.deleted) {
return;
}
const oldVTree = svgVTrees.get(widget);
const newVTree = createSvgElement('g');
for (let ni = 0; ni < vnodes.length; ni++) {
Expand Down

0 comments on commit d22b8b7

Please sign in to comment.