mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
small change synchronization extensions
This commit is contained in:
parent
6de0761180
commit
58e455142a
@ -88,12 +88,16 @@ public class ExtensionHandler {
|
||||
collection.remove(extension);
|
||||
}
|
||||
|
||||
extension.getExtensionObservable().removeListener(this);
|
||||
synchronized (extension) {
|
||||
extension.getExtensionObservable().removeListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
extension.getExtensionObservable().addListener(respondCallback);
|
||||
synchronized (extension) {
|
||||
extension.getExtensionObservable().addListener(respondCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +108,9 @@ public class ExtensionHandler {
|
||||
|
||||
synchronized (collection2) {
|
||||
for (GEarthExtension extension : collection2) {
|
||||
extension.packetIntercept(new HMessage(message));
|
||||
synchronized (extension) {
|
||||
extension.packetIntercept(new HMessage(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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