From 96ee85d1972ee54745637037a2d4dc1b1e7b885d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 4 Mar 2008 13:51:27 -0500 Subject: BUG: Fix memory leak when cmTarget instances are assigned. We really need to get rid of global targets and their associated assignments. --- Source/cmTarget.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7aaa755..33c3032 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3543,6 +3543,8 @@ cmTargetInternalPointer::operator=(cmTargetInternalPointer const& r) // Ideally cmTarget instances should never be copied. However until // we can make a sweep to remove that, this copy constructor avoids // allowing the resources (Internals) to be copied. + cmTargetInternals* oldPointer = this->Pointer; this->Pointer = new cmTargetInternals; + delete oldPointer; return *this; } -- cgit v0.12