Skip to content

Commit f037ebf

Browse files
committed
ThreadService: only shutdown executor if it exists
The previous behavior was rather silly: if the executor did not exist yet, it was created on demand, only to be shutdown. What a waste.
1 parent 94b50be commit f037ebf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/thread/DefaultThreadService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void queue(final Runnable code) {
105105

106106
@Override
107107
public void dispose() {
108-
executor().shutdown();
108+
if (executor != null) executor.shutdown();
109109
}
110110

111111
// -- ThreadFactory methods --

0 commit comments

Comments
 (0)