From ac32e14b818582f916d320bb2d0f94068bcf45ed Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 May 2015 20:41:25 +0000 Subject: fix for memory leak git-svn-id: http://svn.miranda-ng.org/main/trunk@13597 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IEView/src/IEView.cpp | 5 +++-- plugins/IEView/src/IEView.h | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp index e2dbb86833..c21858f8b3 100644 --- a/plugins/IEView/src/IEView.cpp +++ b/plugins/IEView/src/IEView.cpp @@ -913,8 +913,9 @@ void IEView::clear(IEVIEWEVENT *event) void* IEView::getSelection(IEVIEWEVENT *event) { - replaceStrT(selectedText, getSelection()); - if (selectedText == NULL || wcslen(selectedText) == 0) + mir_free(selectedText); + selectedText = getSelection(); + if (mir_wstrlen(selectedText) == 0) return NULL; if (event->dwFlags & IEEF_NO_UNICODE) { diff --git a/plugins/IEView/src/IEView.h b/plugins/IEView/src/IEView.h index e2e1cec47d..8c5692c7d5 100644 --- a/plugins/IEView/src/IEView.h +++ b/plugins/IEView/src/IEView.h @@ -437,11 +437,11 @@ private: IEViewSink *sink; HTMLBuilder *builder; - WNDPROC mainWndProc, docWndProc, serverWndProc; - bool getFocus; - bool clearRequired; - BSTR selectedText; - bool isContactSet; + WNDPROC mainWndProc, docWndProc, serverWndProc; + bool getFocus; + bool clearRequired; + WCHAR* selectedText; + bool isContactSet; MCONTACT hContact; // IUnknown -- cgit v1.2.3