Fix a leak in WebView::setToolTip
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2007 21:02:41 +0000 (21:02 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2007 21:02:41 +0000 (21:02 +0000)
Reviewed by Beth.

* WebView.cpp:
(WebView::setToolTip):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index 796314944ebd846dd2164cc087d7c92b1e82bb35..ef799ab18a4380182c5da6cb22ae2a05ba01f064 100644 (file)
@@ -1,3 +1,12 @@
+2007-07-05  Adam Roben  <aroben@apple.com>
+
+        Fix a leak in WebView::setToolTip
+
+        Reviewed by Beth.
+
+        * WebView.cpp:
+        (WebView::setToolTip):
+
 2007-07-05  Adam Roben  <aroben@apple.com>
 
         Fix Bug 14143: Tooltips not displayed on Windows
index 3621978b9014384032a731bf649cff051edc8ceb..e1b8ecf9353915a833d99a3aee21fbb82f50addf 100644 (file)
@@ -1815,7 +1815,7 @@ void WebView::setToolTip(const String& toolTip)
         info.cbSize = sizeof(info);
         info.uFlags = TTF_IDISHWND;
         info.uId = reinterpret_cast<UINT_PTR>(m_viewWindow);
-        info.lpszText = _wcsdup(m_toolTip.charactersWithNullTermination());
+        info.lpszText = const_cast<UChar*>(m_toolTip.charactersWithNullTermination());
         ::SendMessage(m_toolTipHwnd, TTM_UPDATETIPTEXT, 0, reinterpret_cast<LPARAM>(&info));
     }