lli: Plug leaks in the remote target external implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192031 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2013-10-05 11:53:20 +00:00
parent beb6afa843
commit 5ccfef6a1d
6 changed files with 16 additions and 1 deletions

View File

@ -11,6 +11,7 @@ using namespace llvm;
class LLIChildTarget {
public:
~LLIChildTarget(); // OS-specific destructor
void initialize();
LLIMessageType waitForIncomingMessage();
void handleMessage(LLIMessageType messageType);

View File

@ -49,6 +49,10 @@ struct ConnectionData_t {
} // namespace
LLIChildTarget::~LLIChildTarget() {
delete static_cast<ConnectionData_t *>(ConnectionData);
}
// OS-specific methods
void LLIChildTarget::initializeConnection() {
// Store the parent ends of the pipes

View File

@ -12,6 +12,9 @@
//
//===----------------------------------------------------------------------===//
LLIChildTarget::~LLIChildTarget() {
}
// The RemoteTargetExternal implementation should prevent us from ever getting
// here on Windows, but nothing prevents a user from running this directly.
void LLIChildTarget::initializeConnection() {

View File

@ -88,7 +88,7 @@ public:
virtual void stop();
RemoteTargetExternal(std::string &Name) : RemoteTarget(), ChildName(Name) {}
virtual ~RemoteTargetExternal() {}
virtual ~RemoteTargetExternal();
private:
std::string ChildName;

View File

@ -89,4 +89,8 @@ void RemoteTargetExternal::Wait() {
wait(NULL);
}
RemoteTargetExternal::~RemoteTargetExternal() {
delete static_cast<ConnectionData_t *>(ConnectionData);
}
} // namespace llvm

View File

@ -29,4 +29,7 @@ int RemoteTargetExternal::ReadBytes(void *Data, size_t Size) {
void RemoteTargetExternal::Wait() {
}
RemoteTargetExternal::~RemoteTargetExternal() {
}
} // namespace llvm