mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
SMACK-462 Use getInstace() ConnectionCreationListener
Prevent duplicate instances of a manager by using it's getInstance() method instead of the manager's constructor. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_2@13800 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
0e6817dc4f
commit
49573866ab
5 changed files with 10 additions and 8 deletions
|
@ -47,7 +47,7 @@ public class DeliveryReceiptManager implements PacketListener {
|
|||
static {
|
||||
Connection.addConnectionCreationListener(new ConnectionCreationListener() {
|
||||
public void connectionCreated(Connection connection) {
|
||||
new DeliveryReceiptManager(connection);
|
||||
getInstanceFor(connection);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ public class DeliveryReceiptManager implements PacketListener {
|
|||
*
|
||||
* @return the DeliveryReceiptManager instance for the given connection
|
||||
*/
|
||||
synchronized public static DeliveryReceiptManager getInstanceFor(Connection connection) {
|
||||
public static synchronized DeliveryReceiptManager getInstanceFor(Connection connection) {
|
||||
DeliveryReceiptManager receiptManager = instances.get(connection);
|
||||
|
||||
if (receiptManager == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue