diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-30 23:02:45 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-30 23:02:45 -0400 |
commit | 9449e0e1ade2e706dfc6e7a71eceadb0d5ed700b (patch) | |
tree | 1efd0773d2268eafaec687a5a011ea4056167225 /utils | |
parent | 3b922ac2ee37efd1d606373ae599976bfcaf4b43 (diff) |
fix memory leak!
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fast_sparse_vector.h | 1 |
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); |