BUG: Fix memory leak when cmTarget instances are assigned. We really need to get rid of global targets and their associated assignments.

This commit is contained in:
Brad King 2008-03-04 13:51:27 -05:00
parent bb5325f7f9
commit 96ee85d197
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}