<div dir="ltr">Thanks!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 23, 2014 at 11:05 PM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:akyrtzi@gmail.com" target="_blank">akyrtzi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: akirtzidis<br>
Date: Thu Apr 24 01:05:40 2014<br>
New Revision: 207081<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=207081&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=207081&view=rev</a><br>
Log:<br>
Simplify leak fix of r207076, by just disposing the previous CXString.<br>
<br>
Modified:<br>
cfe/trunk/tools/libclang/CIndex.cpp<br>
<br>
Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=207081&r1=207080&r2=207081&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=207081&r1=207080&r2=207081&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Apr 24 01:05:40 2014<br>
@@ -6027,9 +6027,6 @@ static int getCursorPlatformAvailability<br>
CXPlatformAvailability *availability,<br>
int availability_size) {<br>
bool HadAvailAttr = false;<br>
- bool DidSetDeprecatedMessage = false;<br>
- bool DidSetUnavailableMessage = false;<br>
-<br>
int N = 0;<br>
for (auto A : D->attrs()) {<br>
if (DeprecatedAttr *Deprecated = dyn_cast<DeprecatedAttr>(A)) {<br>
@@ -6037,10 +6034,8 @@ static int getCursorPlatformAvailability<br>
if (always_deprecated)<br>
*always_deprecated = 1;<br>
if (deprecated_message) {<br>
- if (DidSetDeprecatedMessage)<br>
- clang_disposeString(*deprecated_message);<br>
+ clang_disposeString(*deprecated_message);<br>
*deprecated_message = cxstring::createDup(Deprecated->getMessage());<br>
- DidSetDeprecatedMessage = true;<br>
}<br>
continue;<br>
}<br>
@@ -6050,10 +6045,8 @@ static int getCursorPlatformAvailability<br>
if (always_unavailable)<br>
*always_unavailable = 1;<br>
if (unavailable_message) {<br>
- if (DidSetUnavailableMessage)<br>
- clang_disposeString(*unavailable_message);<br>
+ clang_disposeString(*unavailable_message);<br>
*unavailable_message = cxstring::createDup(Unavailable->getMessage());<br>
- DidSetUnavailableMessage = true;<br>
}<br>
continue;<br>
}<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>