From d7c9eb34f80f207efd47d2fc65e31aedf166c323 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 5 Jun 2021 17:50:34 +0300 Subject: major code cleaning in regard to db_event_getBlobSize & event memory allocation --- plugins/ContactsPlus/src/receive.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/ContactsPlus/src/receive.cpp') diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index f4a0b1335d..da8b2230f3 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -195,11 +195,9 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara CheckDlgButton(hwndDlg, IDC_ENABLEGROUPS, BST_UNCHECKED); RebuildGroupCombo(hwndDlg); - { // fill listview with received contacts - DBEVENTINFO dbe = {}; - dbe.cbBlob = db_event_getBlobSize(wndData->mhDbEvent); - if (dbe.cbBlob != -1) // this marks an invalid hDbEvent - all smashed anyway... - dbe.pBlob = (PBYTE)_alloca(dbe.cbBlob); + { // fill listview with received contacts + DB::EventInfo dbe; + dbe.cbBlob = -1; db_event_get(wndData->mhDbEvent, &dbe); char* pcBlob = (char*)dbe.pBlob; char* pcEnd = (char*)dbe.pBlob + dbe.cbBlob; @@ -212,8 +210,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara lvi.iImage = 0; lvi.mask = LVIF_TEXT | LVIF_IMAGE; - for (int nItem = 0; ; nItem++) - { // Nick + for (int nItem = 0; ; nItem++) { // Nick int strsize = (int)strlennull(pcBlob); TReceivedItem* pItem = wndData->AddReceivedItem(); -- cgit v1.2.3