diff options
Diffstat (limited to 'src/FbTk/Resource.cc')
-rw-r--r-- | src/FbTk/Resource.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/FbTk/Resource.cc b/src/FbTk/Resource.cc index 94b31b2..4be85de 100644 --- a/src/FbTk/Resource.cc +++ b/src/FbTk/Resource.cc | |||
@@ -42,7 +42,11 @@ ResourceManager::ResourceManager(const char *filename, bool lock_db) : | |||
42 | m_database(0), | 42 | m_database(0), |
43 | m_filename(filename ? filename : "") | 43 | m_filename(filename ? filename : "") |
44 | { | 44 | { |
45 | ensureXrmIsInitialize(); | 45 | static bool xrm_initialized = false; |
46 | if (!xrm_initialized) { | ||
47 | XrmInitialize(); | ||
48 | xrm_initialized = true; | ||
49 | } | ||
46 | 50 | ||
47 | if (lock_db) | 51 | if (lock_db) |
48 | lock(); | 52 | lock(); |
@@ -53,7 +57,6 @@ ResourceManager::~ResourceManager() { | |||
53 | delete m_database; | 57 | delete m_database; |
54 | } | 58 | } |
55 | 59 | ||
56 | bool ResourceManager::m_init = false; | ||
57 | 60 | ||
58 | /** | 61 | /** |
59 | reloads all resources from resourcefile | 62 | reloads all resources from resourcefile |
@@ -198,13 +201,6 @@ void ResourceManager::setResourceValue(const string &resname, const string &valu | |||
198 | 201 | ||
199 | } | 202 | } |
200 | 203 | ||
201 | void ResourceManager::ensureXrmIsInitialize() { | ||
202 | if (!m_init) { | ||
203 | XrmInitialize(); | ||
204 | m_init = true; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | ResourceManager &ResourceManager::lock() { | 204 | ResourceManager &ResourceManager::lock() { |
209 | ++m_db_lock; | 205 | ++m_db_lock; |
210 | // if the lock was zero, then load the database | 206 | // if the lock was zero, then load the database |