Skip to content

Commit e9678a3

Browse files
committed
settings: don't use contrived singleton implementation
- avoids seg fault - not necessary, because we're using only a single instance anyway
1 parent 033c375 commit e9678a3

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

pyqt_code_editor/_settings.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,10 @@ class Settings(QObject):
5757
# Signal emitted when any setting changes: (setting_name, new_value)
5858
setting_changed = Signal(str, object)
5959

60-
# Singleton instance
61-
_instance = None
62-
63-
def __new__(cls):
64-
if cls._instance is None:
65-
cls._instance = super(Settings, cls).__new__(cls)
66-
cls._instance._initialized = False
67-
return cls._instance
68-
69-
def __init__(self):
70-
if self._initialized:
71-
return
72-
60+
def __init__(self):
7361
super().__init__()
7462
self._values = {}
7563
self._qsettings = QSettings("cogscinl", "Sigmund Analyst")
76-
self._initialized = True
7764
logger.info("Initializing Settings manager")
7865
self._load_settings()
7966

0 commit comments

Comments
 (0)