chetant/LibClang — pull request #18 by sfowler (2013-03-21 02:07:09+00:00)
Title: Fix misuse of ForeignPtrs that caused corruption in code using CXString

The CXString ForeignPtrs were dropping out of scope too soon, causing the finalizer to run and free the strings before callers could actually complete their final action with them. This commit adds wrappers around API calls that take CXStrings as parameters (most importantly clang_getCString, but I covered all the other ones as well) that ensure that the CXString ForeignPtrs stay in scope until they're no longer needed. This resolves the data corruption in the ChildVisitor test.