From e5861b4df1e3918f36e607135ef749e41846c66b Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 27 Jan 2013 18:41:40 +0000 Subject: [PATCH] =?UTF-8?q?[BUG=5FFIXED]=20(Author:=20Pekka=20P=C3=B6yry)?= =?UTF-8?q?=20Fix=20the=20problem=20that=20calltip=20becomes=20garbage=20a?= =?UTF-8?q?fter=20switching=20document.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1014 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp index c08da3739..8dafb668a 100644 --- a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp +++ b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp @@ -82,6 +82,14 @@ void FunctionCallTip::setLanguageXML(TiXmlElement * pXmlKeyword) { if (isVisible()) close(); _pXmlKeyword = pXmlKeyword; + + // Clear all buffered values, because they may point to freed memory area. + reset(); + + // Also clear _funcName so that next getCursorFunction will call loadFunction to parse XML structure + if (_funcName) + delete [] _funcName; + _funcName = 0; } bool FunctionCallTip::updateCalltip(int ch, bool needShown) {