diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-19 09:23:58 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-03-19 09:23:58 +0000 |
commit | 68fa3d953d9741dba28df0cd1b979904a59c1085 (patch) | |
tree | c347ae808392c9414e9f8836ddea3ffeef4699b4 /plugins | |
parent | 7004aed31ae77fd1e75e3ffd5e563172ff686cde (diff) |
UserInfoEx:
- Fixed memory leak
git-svn-id: http://svn.miranda-ng.org/main/trunk@16506 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/UserInfoEx/src/classPsTreeItem.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 57c488a0a1..05b88064ec 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -44,23 +44,19 @@ BOOL CALLBACK BoldGroupTitlesEnumChildren(HWND hWnd, LPARAM lParam) * odp - optiondialogpage structure with the info about the item to add
* return: nothing
**/
-CPsTreeItem::CPsTreeItem()
+CPsTreeItem::CPsTreeItem() : _idDlg(NULL), _pTemplate(NULL), _hInst(NULL), _pfnDlgProc(NULL), _hWnd(NULL), _dwFlags(NULL),
+ _hItem(NULL), // handle to the treeview item
+ _iParent(-1), // index to the parent item
+ _iImage(-1), // index of treeview item's image
+ _bState(NULL), // initial state of this treeitem
+ _pszName(NULL), // original name, given by plugin (not customized)
+ _ptszLabel(NULL),
+ _pszProto(NULL),
+ _pszPrefix(NULL),
+ _hContact(NULL),
+ _iPosition(0),
+ _initParam(0)
{
- _idDlg = NULL;
- _pTemplate = NULL;
- _hInst = NULL;
- _pfnDlgProc = NULL;
- _hWnd = NULL;
- _dwFlags = NULL;
- _hItem = NULL; // handle to the treeview item
- _iParent = -1; // index to the parent item
- _iImage = -1; // index of treeview item's image
- _bState = NULL; // initial state of this treeitem
- _pszName = NULL; // original name, given by plugin (not customized)
- _ptszLabel = NULL;
- _pszProto = NULL;
- _pszPrefix = NULL;
- _hContact = NULL;
}
/**
@@ -217,7 +213,9 @@ void CPsTreeItem::Rename(const LPTSTR pszLabel) if (pszLabel && *pszLabel) {
LPTSTR pszDup = mir_tstrdup(pszLabel);
if (pszDup) {
- replaceStrT(_ptszLabel, pszDup);
+ if (_ptszLabel)
+ mir_free(_ptszLabel);
+ _ptszLabel = pszDup;
// convert disallowed characters
while(*pszDup) {
switch(*pszDup) {
|