[fixes #733] fixes rare bug -- rocket sometimes sends events to deleted ComponentConfigDialog instances

This commit is contained in:
Daniel_M_Williams 2020-08-02 17:40:03 -04:00
parent 917503149c
commit 1a261a7c75
2 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,12 @@ public class ComponentConfigDialog extends JDialog implements ComponentChangeLis
this.pack();
}
public static ComponentConfigDialog getDialog() {
return dialog;
}
/**
/**
* Return the configurator panel of the current component.
*/

View File

@ -311,6 +311,8 @@ public class RocketActions {
if (isDeletable(c)) {
ComponentConfigDialog.hideDialog();
c.getRocket().removeComponentChangeListener(ComponentConfigDialog.getDialog());
document.addUndoPosition("Delete " + c.getComponentName());
delete(c);
}