mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-27 02:40:51 +01:00
small change synchronization extensions
This commit is contained in:
parent
6de0761180
commit
58e455142a
@ -88,14 +88,18 @@ public class ExtensionHandler {
|
||||
collection.remove(extension);
|
||||
}
|
||||
|
||||
synchronized (extension) {
|
||||
extension.getExtensionObservable().removeListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
synchronized (extension) {
|
||||
extension.getExtensionObservable().addListener(respondCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set<GEarthExtension> collection2;
|
||||
synchronized (collection) {
|
||||
@ -104,9 +108,11 @@ public class ExtensionHandler {
|
||||
|
||||
synchronized (collection2) {
|
||||
for (GEarthExtension extension : collection2) {
|
||||
synchronized (extension) {
|
||||
extension.packetIntercept(new HMessage(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//block untill all extensions have responded
|
||||
List<GEarthExtension> willdelete = new ArrayList<>();
|
||||
|
@ -48,7 +48,7 @@ public abstract class GEarthExtension {
|
||||
|
||||
// ----------------- listen to the extension ---------------------
|
||||
|
||||
protected final Observable<ExtensionListener> extensionObservable = new Observable<>();
|
||||
protected final Observable<ExtensionListener> extensionObservable = new SynchronizedObservable<>();
|
||||
public Observable<ExtensionListener> getExtensionObservable() {
|
||||
return extensionObservable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user