Make NullClientCaps a singleto so that we don't create a new object for each contact.
This commit is contained in:
parent
65ba840cbd
commit
da0749b5d9
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
cd "$(dirname $0)/src"
|
||||
exec python -OOt gajim.py "$@"
|
||||
exec python -m cProfile gajim.py "$@"
|
||||
|
|
|
@ -245,6 +245,16 @@ class NullClientCaps(AbstractClientCaps):
|
|||
|
||||
Assumes (almost) everything is supported.
|
||||
"""
|
||||
_instance = None
|
||||
def __new__(cls, *args, **kwargs):
|
||||
"""
|
||||
Make it a singleton.
|
||||
"""
|
||||
if not cls._instance:
|
||||
cls._instance = super(NullClientCaps, cls).__new__(
|
||||
cls, *args, **kwargs)
|
||||
return cls._instance
|
||||
|
||||
def __init__(self):
|
||||
AbstractClientCaps.__init__(self, None, None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue