Skip to content

Commit

Permalink
more includes tracefile; better interlock on clearAll
Browse files Browse the repository at this point in the history
  • Loading branch information
bobjacobsen committed Apr 22, 2018
1 parent 93ee5d8 commit bd6e8a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion java/src/jmri/InstanceManager.java
Expand Up @@ -796,10 +796,17 @@ private void dispose(@Nonnull Disposable disposable) {
}

/**
* Clear all managed instances from this InstanceManager.
* Clear all managed instances from the common instance manager, effectively
* installing a new one.
*/
public void clearAll() {
log.debug("Clearing InstanceManager");
if (traceFileActive) traceFileWriter.println("clearAll");

// replace the instance manager, so future calls will invoke the new one
LazyInstanceManager.instanceManager = new InstanceManager();

// continue to clean up this one
new HashSet<>(managerLists.keySet()).forEach((type) -> {
clear(type);
});
Expand Down

0 comments on commit bd6e8a4

Please sign in to comment.