diff options
author | Brad King <brad.king@kitware.com> | 2008-03-04 18:51:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-03-04 18:51:27 (GMT) |
commit | 96ee85d1972ee54745637037a2d4dc1b1e7b885d (patch) | |
tree | e0e93545fb4c2651d7dbf6fbee626cd4ca4d4f0e /Source/cmTarget.cxx | |
parent | bb5325f7f9ea4ee4c8e3052c64884ed688b3d43c (diff) | |
download | CMake-96ee85d1972ee54745637037a2d4dc1b1e7b885d.zip CMake-96ee85d1972ee54745637037a2d4dc1b1e7b885d.tar.gz CMake-96ee85d1972ee54745637037a2d4dc1b1e7b885d.tar.bz2 |
BUG: Fix memory leak when cmTarget instances are assigned. We really need to get rid of global targets and their associated assignments.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |