summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx2
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;
}