summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-04-30 23:02:45 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2011-04-30 23:02:45 -0400
commit9449e0e1ade2e706dfc6e7a71eceadb0d5ed700b (patch)
tree1efd0773d2268eafaec687a5a011ea4056167225 /utils
parent3b922ac2ee37efd1d606373ae599976bfcaf4b43 (diff)
fix memory leak!
Diffstat (limited to 'utils')
-rw-r--r--utils/fast_sparse_vector.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/fast_sparse_vector.h b/utils/fast_sparse_vector.h
index b9315235..8d381b60 100644
--- a/utils/fast_sparse_vector.h
+++ b/utils/fast_sparse_vector.h
@@ -127,6 +127,7 @@ class FastSparseVector {
}
const FastSparseVector<T>& operator=(const FastSparseVector<T>& other) {
if (&other == this) return *this;
+ clear();
std::memcpy(this, &other, sizeof(FastSparseVector));
if (is_remote_)
data_.rbmap = new std::map<int, T>(*data_.rbmap);