diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-20 21:59:59 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-02-20 21:59:59 +0000 |
commit | 6ff4388ffa56fcf2fb398bd893a79f008af7efdc (patch) | |
tree | b82f1257a90f12401399eac4b0c9aeee88881003 /util.cpp | |
parent | 794298063de40a6837736f9d928d28c2d6712a73 (diff) |
Address Book with tabs instead of separate Your Address book,
with live update of default address in main window,
New... button on main window for creating new receiving address,
made receiving address labels more visible,
ask user before paying transaction fee,
when sending to bitcoin address also use a bitcoin address for the change,
added some event.Skip() to fix UI glitches
-- version 0.2.4
Diffstat (limited to 'util.cpp')
-rw-r--r-- | util.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -445,10 +445,14 @@ const char* wxGetTranslation(const char* pszEnglish) // wxWidgets translation
const char* pszTranslated = wxGetTranslation(wxString(pszEnglish, wxConvUTF8)).utf8_str();
+
+ // We don't cache unknown strings because caller might be passing in a
+ // dynamic string and we would keep allocating memory for each variation.
if (strcmp(pszEnglish, pszTranslated) == 0)
return pszEnglish;
- // Add to cache, memory doesn't need to be freed
+ // Add to cache, memory doesn't need to be freed. We only cache because
+ // we must pass back a pointer to permanently allocated memory.
char* pszCached = new char[strlen(pszTranslated)+1];
strcpy(pszCached, pszTranslated);
mapCache[pszEnglish] = pszCached;
|