summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-06 14:25:40 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-06 14:25:40 +0300
commite1a0ac05c7df7e238d931ddce9efb4e332089c90 (patch)
treec6952202cc145e44b04dd655743c2b54a7c16171 /plugins/Clist_modern
parent0c1573c1349f029dfb716072b692084f33c2d645 (diff)
code optimization
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/cluiframes.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp4
4 files changed, 16 insertions, 16 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp
index 203bf381e2..fb47d34952 100644
--- a/plugins/Clist_modern/src/cluiframes.cpp
+++ b/plugins/Clist_modern/src/cluiframes.cpp
@@ -1047,7 +1047,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam)
return -1;
if (fw.TitleBar.tooltip != nullptr)
- mir_free_and_nil(fw.TitleBar.tooltip);
+ replaceStrW(fw.TitleBar.tooltip, nullptr);
if (bUnicodeText)
fw.TitleBar.tooltip = mir_wstrdup((LPTSTR)lParam);
else
@@ -1641,9 +1641,9 @@ static int _us_DoRemoveFrame(WPARAM wParam, LPARAM)
if (pos < 0 || pos>g_nFramesCount) return -1;;
FRAMEWND &F = g_pfwFrames[pos];
- mir_free_and_nil(F.name);
- mir_free_and_nil(F.TitleBar.tbname);
- mir_free_and_nil(F.TitleBar.tooltip);
+ replaceStrW(F.name, nullptr);
+ replaceStrW(F.TitleBar.tbname, nullptr);
+ replaceStrW(F.TitleBar.tooltip, nullptr);
DestroyWindow(F.hWnd);
F.hWnd = (HWND)-1;
DestroyWindow(F.TitleBar.hwnd);
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 265647f2a1..5136c50c69 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void cliFreeCacheItem(ClcCacheEntry *p)
{
- mir_free_and_nil(p->szSecondLineText);
- mir_free_and_nil(p->szThirdLineText);
+ replaceStrW(p->szSecondLineText, nullptr);
+ replaceStrW(p->szThirdLineText, nullptr);
p->ssSecondLine.DestroySmileyList();
p->ssThirdLine.DestroySmileyList();
@@ -49,7 +49,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce)
if (pdnce->szProto == nullptr) {
pdnce->szProto = Proto_GetBaseAccountName(pdnce->hContact);
if (pdnce->szProto && pdnce->tszName)
- mir_free_and_nil(pdnce->tszName);
+ replaceStrW(pdnce->tszName, nullptr);
}
if (pdnce->tszName == nullptr) {
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index c663e03164..36ea9594a3 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -1343,7 +1343,7 @@ int ske_AddDescriptorToSkinObjectList(SKINOBJECTDESCRIPTOR *lpDescr, SKINOBJECTS
memcpy(obdat, gl, sizeof(GLYPHOBJECT));
if (gl->szFileName != nullptr) {
obdat->szFileName = mir_strdup(gl->szFileName);
- mir_free_and_nil(gl->szFileName);
+ replaceStr(gl->szFileName, nullptr);
}
else obdat->szFileName = nullptr;
@@ -1712,7 +1712,7 @@ int ske_UnloadGlyphImage(HBITMAP hbmp)
pLoadedImages[i].dwLoadedTimes--;
if (pLoadedImages[i].dwLoadedTimes == 0) {
LPGLYPHIMAGE gl = &(pLoadedImages[i]);
- mir_free_and_nil(gl->szFileName);
+ replaceStrW(gl->szFileName, nullptr);
memmove(&(pLoadedImages[i]), &(pLoadedImages[i + 1]), sizeof(GLYPHIMAGE) * (dwLoadedImagesCount - i - 1));
dwLoadedImagesCount--;
DeleteObject(hbmp);
@@ -1745,7 +1745,7 @@ int ske_UnloadSkin(SKINOBJECTSLIST *Skin)
mir_free_and_nil(gl_plSkinFonts);
}
- mir_free_and_nil(Skin->szSkinPlace);
+ replaceStrW(Skin->szSkinPlace, nullptr);
if (Skin->pTextList) List_Destroy(Skin->pTextList);
mir_free_and_nil(Skin->pTextList);
ModernSkinButtonDeleteAll();
@@ -1759,7 +1759,7 @@ int ske_UnloadSkin(SKINOBJECTSLIST *Skin)
if (dt->hGlyph && dt->hGlyph != (HBITMAP)-1)
ske_UnloadGlyphImage(dt->hGlyph);
dt->hGlyph = nullptr;
- mir_free_and_nil(dt->szFileName);
+ replaceStr(dt->szFileName, nullptr);
if (dt->plTextList && dt->plTextList->realCount > 0) {
for (int k = 0; k < dt->plTextList->realCount; k++) {
@@ -1778,7 +1778,7 @@ int ske_UnloadSkin(SKINOBJECTSLIST *Skin)
mir_free(dt);
break;
}
- mir_free_and_nil(Skin->pObjects[i].szObjectID);
+ replaceStr(Skin->pObjects[i].szObjectID, nullptr);
}
mir_free_and_nil(Skin->pObjects);
Skin->pTextList = nullptr;
@@ -1844,7 +1844,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST *pObjectList)
for (DWORD i = 0; i < pObjectList->pMaskList->dwMaskCnt; i++) {
MODERNMASK *mm = &(pObjectList->pMaskList->pl_Masks[i]);
void *pObject = (void *)ske_FindObjectByName(mm->szObjectName, OT_ANY, (SKINOBJECTSLIST *)pObjectList);
- mir_free_and_nil(mm->szObjectName);
+ replaceStr(mm->szObjectName, nullptr);
mm->bObjectFound = TRUE;
mm->pObject = pObject;
}
@@ -1854,7 +1854,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST *pObjectList)
for (int i = 0; i < pObjectList->pTextList->realCount; i++) {
GLYPHTEXT *glText = (GLYPHTEXT *)pObjectList->pTextList->items[i];
SKINOBJECTDESCRIPTOR *lpobj = ske_FindObjectByName(glText->szObjectName, OT_GLYPHOBJECT, pObjectList);
- mir_free_and_nil(glText->szObjectName);
+ replaceStr(glText->szObjectName, nullptr);
GLYPHOBJECT *globj = nullptr;
if (lpobj)
globj = (GLYPHOBJECT*)lpobj->Data;
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index 79d39745a0..4c12aa9478 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -543,8 +543,8 @@ int RegisterObjectByParce(char *ObjectName, char *Params)
obj.Data = &gl;
int res = ske_AddDescriptorToSkinObjectList(&obj, nullptr);
- mir_free_and_nil(obj.szObjectID);
- mir_free_and_nil(gl.szFileName);
+ replaceStr(obj.szObjectID, nullptr);
+ replaceStr(gl.szFileName, nullptr);
return res;
}