Skip to content

Commit

Permalink
Deregister Audio object with manager on dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
mattharris committed Nov 24, 2019
1 parent 516e52a commit 0022ecd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions java/src/jmri/implementation/AbstractAudio.java
@@ -1,6 +1,7 @@
package jmri.implementation;

import jmri.Audio;
import jmri.InstanceManager;

/**
* Base implementation of the Audio class.
Expand Down Expand Up @@ -58,6 +59,12 @@ public String toString() {
*/
abstract protected void cleanup();

@Override
public void dispose() {
InstanceManager.getDefault(jmri.AudioManager.class).deregister(this);
super.dispose();
}

/**
* Static method to round a float value to the specified number of decimal
* places
Expand Down

0 comments on commit 0022ecd

Please sign in to comment.