Skip to content
Snippets Groups Projects
Commit da0749b5 authored by steve-e's avatar steve-e
Browse files

Make NullClientCaps a singleto so that we don't create a new object for each contact.

parent 65ba840c
No related branches found
No related tags found
No related merge requests found
#!/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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment