Make sure temporary files get unlinked.
llvm-svn: 84208
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 33099cc..5e999c1 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -325,7 +325,10 @@
} while (tpid != child_pid);
// Finally, we create the translation unit from the ast file.
- return clang_createTranslationUnit(CIdx, astTmpFile);
+ ASTUnit *ATU = static_cast<ASTUnit *>(
+ clang_createTranslationUnit(CIdx, astTmpFile));
+ ATU->unlinkTemporaryFile();
+ return ATU;
}
void clang_disposeTranslationUnit(