Commit 96ee85d1 authored by Brad King's avatar Brad King
Browse files

BUG: Fix memory leak when cmTarget instances are assigned. We really need to...

BUG: Fix memory leak when cmTarget instances are assigned.  We really need to get rid of global targets and their associated assignments.
parent bb5325f7
...@@ -3543,6 +3543,8 @@ cmTargetInternalPointer::operator=(cmTargetInternalPointer const& r) ...@@ -3543,6 +3543,8 @@ cmTargetInternalPointer::operator=(cmTargetInternalPointer const& r)
// Ideally cmTarget instances should never be copied. However until // Ideally cmTarget instances should never be copied. However until
// we can make a sweep to remove that, this copy constructor avoids // we can make a sweep to remove that, this copy constructor avoids
// allowing the resources (Internals) to be copied. // allowing the resources (Internals) to be copied.
cmTargetInternals* oldPointer = this->Pointer;
this->Pointer = new cmTargetInternals; this->Pointer = new cmTargetInternals;
delete oldPointer;
return *this; return *this;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment