File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/main/java/org/scijava/plugin Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,7 @@ public abstract class AbstractSingletonService<PT extends SingletonPlugin>
6565
6666 @ Override
6767 public List <PT > getInstances () {
68- if (instances == null ) {
69- createInstances ();
70- }
68+ if (instances == null ) initInstances ();
7169 return instances ;
7270 }
7371
@@ -93,18 +91,15 @@ public ArrayList<Object> get() {
9391
9492 // -- Helper methods --
9593
96- private void createInstances () {
94+ private synchronized void initInstances () {
95+ if (instances != null ) return ;
96+
9797 instances =
9898 Collections .unmodifiableList (filterInstances (getPluginService ()
9999 .createInstancesOfType (getPluginType ())));
100100
101101 log .info ("Found " + instances .size () + " " +
102102 getPluginType ().getSimpleName () + " plugins." );
103-
104- // register singleton instances with the object service
105- for (final PT instance : instances ) {
106- objectService .addObject (instance );
107- }
108103 }
109104
110105 /**
You can’t perform that action at this time.
0 commit comments