From 8303b79ef72ab7622e3aae79d3eec448bdc049f5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 6 Jun 2007 17:34:16 +0000 Subject: [PATCH] fixed a crash bug in translation file loading where big files would reset the string cache and not update pointers --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40893 --- core/Translator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/Translator.cpp b/core/Translator.cpp index 52070e8a..56b7345d 100644 --- a/core/Translator.cpp +++ b/core/Translator.cpp @@ -164,7 +164,12 @@ SMCParseResult CPhraseFile::ReadSMC_NewSection(const char *name, bool opt_quotes pPhrase->fmt_count = 0; pPhrase->fmt_list = -1; - pPhrase->trans_tbl = m_pMemory->CreateMem(sizeof(trans_t) * m_LangCount, (void **)&pTrans); + + int trans_tbl = m_pMemory->CreateMem(sizeof(trans_t) * m_LangCount, (void **)&pTrans); + /* Update the pointer! */ + pPhrase = (phrase_t *)m_pMemory->GetAddress(m_CurPhrase); + pPhrase->trans_tbl = trans_tbl; + pPhrase->translations = 0; pPhrase->fmt_bytes = 0;