Skip to content
Permalink
Browse files

update LocoNet dispose methods (#7350)

* Remove override of parent's dispose method in two classes
* Remove override of parent's dispose method
* add missing super.dispose()
* add missing dispose method
* protect against uninitialized timers
  • Loading branch information...
devel-bobm committed Aug 23, 2019
1 parent 5ed60fd commit 85c94b4491c90d1110ee91db5fdbc0dcfbf324e8
@@ -421,6 +421,21 @@ private void changeOpSwBytes(int cmdStnOpSwNum, boolean cmdStnOpSwVal) {
public CmdStnOpSwStateType getState() {
return cmdStnOpSwState;
}

/**
* Dispose of object's helper objects
*
* Stops the timers
*
*/
public void dispose() {
if (csOpSwAccessTimer != null) {
csOpSwAccessTimer.stop();
}
if (csOpSwValidTimer != null) {
csOpSwValidTimer.stop();
}
}

// initialize logging
private final static Logger log = LoggerFactory.getLogger(CsOpSwAccess.class);
@@ -193,14 +193,6 @@ public void setState(int s) {
}
int lastLoco = -1;

/**
* {@inheritDoc}
*/
@Override
public void dispose() {
super.dispose();
}

/**
* Parses out a (possibly old) LnReporter-generated report string to extract info used by
* the public PhysicalLocationReporter methods. Returns a Matcher that, if successful, should
@@ -64,12 +64,6 @@ public LocoNetConsist(DccLocoAddress address, LocoNetSystemConnectionMemo lm) {
throttleManager.requestThrottle(consistAddress, this, false);
}

// Clean Up local storage
@Override
public void dispose() {
super.dispose();
}

// Set the Consist Type
@Override
public void setConsistType(int consist_type) {
@@ -224,6 +224,7 @@ public void message(LocoNetMessage l) {
@Override
public void dispose() {
tc.removeLocoNetListener(~0, this);
super.dispose();
}

// data members

0 comments on commit 85c94b4

Please sign in to comment.
You can’t perform that action at this time.