summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-17 08:11:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-17 08:11:13 +0000
commitd07b88876d58517b79fe6115261b2c87052feaae (patch)
treee82414b77787e082c8688cad1163b67200b1908f /src
parentb13d3e39e161dd4804b1d6f1b92f39aed7886160 (diff)
fix for a crash with german langpack
git-svn-id: http://svn.miranda-ng.org/main/trunk@14229 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/mstring.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mir_core/src/mstring.cpp b/src/mir_core/src/mstring.cpp
index 1ce935a2e3..b3c6e99094 100644
--- a/src/mir_core/src/mstring.cpp
+++ b/src/mir_core/src/mstring.cpp
@@ -45,7 +45,7 @@ CNilMStringData::CNilMStringData()
achNil[1] = 0;
}
-static CNilMStringData m_nil;
+static CNilMStringData *m_nil = NULL;
/////////////////////////////////////////////////////////////////////////////////////////
// CMBaseString
@@ -68,8 +68,7 @@ MIR_CORE_DLL(CMStringData*) mirstr_allocate(int nChars, int nCharSize)
MIR_CORE_DLL(void) mirstr_free(CMStringData *pData)
{
- if (pData != &m_nil)
- free(pData);
+ free(pData);
}
MIR_CORE_DLL(CMStringData*) mirstr_realloc(CMStringData* pData, int nChars, int nCharSize)
@@ -88,8 +87,10 @@ MIR_CORE_DLL(CMStringData*) mirstr_realloc(CMStringData* pData, int nChars, int
MIR_CORE_DLL(CMStringData*) mirstr_getNil()
{
- m_nil.AddRef();
- return &m_nil;
+ if (m_nil == NULL)
+ m_nil = new CNilMStringData();
+ m_nil->AddRef();
+ return m_nil;
}
/////////////////////////////////////////////////////////////////////////////////////////