X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fmodule%2Frepository%2FUpdateListener.java;h=d55b6360f49b67d0cb6e0d69e89a8848e2921e67;hp=4e3ad119d77bc5a686577e00090bea4b177a6305;hb=7a2202d5fdd3da3c9b5fdf5e56f10de24df2774e;hpb=8daf1d98d61e83fc6450ddac8e800476a9d52ab3 diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/repository/UpdateListener.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/repository/UpdateListener.java index 4e3ad119d..d55b6360f 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/repository/UpdateListener.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/repository/UpdateListener.java @@ -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; } } }