mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 10:49:41 +02:00
Switched from volatile collection to copy on write array. Fixes concurrency bugs and leaking resources, but may have performance ramifications.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7159 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
4cfbf00e48
commit
7c847dad6a
3 changed files with 41 additions and 175 deletions
|
@ -744,10 +744,8 @@ public class XMPPConnection {
|
|||
if (connectionListener == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (packetReader.connectionListeners) {
|
||||
if (!packetReader.connectionListeners.contains(connectionListener)) {
|
||||
packetReader.connectionListeners.add(connectionListener);
|
||||
}
|
||||
if (!packetReader.connectionListeners.contains(connectionListener)) {
|
||||
packetReader.connectionListeners.add(connectionListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -757,9 +755,7 @@ public class XMPPConnection {
|
|||
* @param connectionListener a connection listener.
|
||||
*/
|
||||
public void removeConnectionListener(ConnectionListener connectionListener) {
|
||||
synchronized (packetReader.connectionListeners) {
|
||||
packetReader.connectionListeners.remove(connectionListener);
|
||||
}
|
||||
packetReader.connectionListeners.remove(connectionListener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue