[fix] Adds duplicate guard when add a 'ComponentChangeListener' to the rocket
This commit is contained in:
parent
58eb9fff90
commit
644404b070
@ -413,7 +413,9 @@ public class Rocket extends ComponentAssembly {
|
||||
@Override
|
||||
public void addComponentChangeListener(ComponentChangeListener l) {
|
||||
checkState();
|
||||
listenerList.add(l);
|
||||
if( ! listenerList.contains(l)) {
|
||||
listenerList.add(l);
|
||||
}
|
||||
log.trace("Added ComponentChangeListener " + l + ", current number of listeners is " +
|
||||
listenerList.size());
|
||||
}
|
||||
|
@ -60,10 +60,6 @@ public class ComponentConfigDialog extends JDialog implements ComponentChangeLis
|
||||
* @param component Component to configure.
|
||||
*/
|
||||
private void setComponent(OpenRocketDocument document, RocketComponent component) {
|
||||
if (this.document != null) {
|
||||
this.document.getRocket().removeComponentChangeListener(this);
|
||||
}
|
||||
|
||||
if (configurator != null) {
|
||||
// Remove listeners by setting all applicable models to null
|
||||
GUIUtil.setNullModels(configurator); // null-safe
|
||||
|
Loading…
x
Reference in New Issue
Block a user