From 0dd998f1a2d1ca3a3fca9bc6ea85c40ccfeae850 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 12 May 2019 20:38:09 +0300 Subject: fixes #1948 (memory allocation problem in Scriver) --- plugins/Scriver/src/sendqueue.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'plugins/Scriver/src/sendqueue.h') diff --git a/plugins/Scriver/src/sendqueue.h b/plugins/Scriver/src/sendqueue.h index 1efb70dbe4..092d43a602 100644 --- a/plugins/Scriver/src/sendqueue.h +++ b/plugins/Scriver/src/sendqueue.h @@ -24,8 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef SRMM_SENDQUEUE_H #define SRMM_SENDQUEUE_H -struct MessageSendQueueItem +struct MessageSendQueueItem : public MZeroedObject { + ~MessageSendQueueItem() + { + mir_free(proto); + mir_free(sendBuffer); + } + HWND hwndSender; MCONTACT hContact; char *proto; @@ -36,18 +42,16 @@ struct MessageSendQueueItem int codepage; int flags; HWND hwndErrorDlg; - - MessageSendQueueItem *prev, *next; }; MessageSendQueueItem* CreateSendQueueItem(HWND hwndSender); -wchar_t * GetSendBufferMsg(MessageSendQueueItem *item); MessageSendQueueItem* FindOldestPendingSendQueueItem(HWND hwndSender, MCONTACT hContact); MessageSendQueueItem* FindSendQueueItem(MCONTACT hContact, HANDLE hSendId); -BOOL RemoveSendQueueItem(MessageSendQueueItem* item); + +bool RemoveSendQueueItem(MessageSendQueueItem* item); void ReportSendQueueTimeouts(HWND hwndSender); void ReleaseSendQueueItems(HWND hwndSender); -int ReattachSendQueueItems(HWND hwndSender, MCONTACT hContact); +int ReattachSendQueueItems(HWND hwndSender, MCONTACT hContact); void RemoveAllSendQueueItems(); void SendSendQueueItem(MessageSendQueueItem* item); -- cgit v1.2.3