]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/repository/UpdateListener.java
Fixes to thread safety problems in SCL compiler
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / module / repository / UpdateListener.java
index 4e3ad119d77bc5a686577e00090bea4b177a6305..d55b6360f49b67d0cb6e0d69e89a8848e2921e67 100644 (file)
@@ -29,13 +29,16 @@ public abstract class UpdateListener {
     }
 
     /**
-     * Stops listening changes. 
+     * Stops listening changes. Returns true, if the listener was listening something. 
      */
-    public void stopListening() {
+    public boolean stopListening() {
         synchronized(observables) {
+            if(observables.isEmpty())
+                return false;
             for(Observable observable : observables)
                 observable.removeListener(this);
             observables.clear();
+            return true;
         }
     }
 }