summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_utils.h19
-rw-r--r--protocols/JabberG/src/jabber_util.cpp8
2 files changed, 14 insertions, 13 deletions
diff --git a/include/m_utils.h b/include/m_utils.h
index 7b25987b6a..fb9c2529eb 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -471,14 +471,17 @@ __forceinline TCHAR* Utils_ReplaceVarsT(const TCHAR *szData) {
typedef struct
{
- int cbSize; // structure size
- int type; // one of ESF_* constants
- LPCSTR szModuleName; // module name to save window size and combobox strings
- LPCSTR szDataPrefix; // prefix for stored database variables
- LPCTSTR caption; // window caption
- LPTSTR *result; // initial value + result entered
- int recentCount; // number of combobox strings to store
- int timeout; // timeout for the form auto-close
+ int cbSize; // structure size
+ int type; // one of ESF_* constants
+ LPCSTR szModuleName; // module name to save window size and combobox strings
+ LPCSTR szDataPrefix; // prefix for stored database variables
+ LPCTSTR caption; // window caption
+ union {
+ LPCTSTR ptszInitVal; // initial value (note: the core DOES NOT free it)
+ LPTSTR ptszResult; // result entered (must be freed via mir_free)
+ };
+ int recentCount; // number of combobox strings to store
+ int timeout; // timeout for the form auto-close
}
ENTER_STRING;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index ff95a160ee..d73ff4cce4 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -1016,8 +1016,6 @@ BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char
result.Empty();
}
- TCHAR *pData = mir_tstrdup(result);
-
ENTER_STRING param = { sizeof(param) };
param.type = type;
param.caption = caption;
@@ -1025,11 +1023,11 @@ BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char
param.szDataPrefix = windowName;
param.recentCount = recentCount;
param.timeout = timeout;
- param.result = &pData;
+ param.ptszInitVal = result;
BOOL res = ::EnterString(&param);
if (res) {
- result = pData;
- mir_free(pData);
+ result = param.ptszResult;
+ mir_free(param.ptszResult);
}
return res;
}