Skip to content

Commit b0d0862

Browse files
committed
Only clean up variables if they were created
Otherwise we will start a MATLAB instance any time Fiji quits.
1 parent 48e9559 commit b0d0862

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/org/scijava/plugins/scripting/matlab/DefaultMATLABService.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,12 @@ private synchronized void createCommandVariables() {
127127
* MATLAB.
128128
*/
129129
private void removeCommandVariables() {
130-
for (final MATLABCommands command : getInstances()) {
131-
final String name = command.getInfo().getName();
130+
if (initializedCommands) {
131+
for (final MATLABCommands command : getInstances()) {
132+
final String name = command.getInfo().getName();
132133

133-
makeMATLABVariable(name, null);
134+
makeMATLABVariable(name, null);
135+
}
134136
}
135137
}
136138
}

0 commit comments

Comments
 (0)