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
commita53e3f0f5d1a4a96479544b5c48a2eb1dcdb4064 (patch)
tree2c8f2fa9896cc6134d224f7c61bb0ff870253a63 /utils
parent97aa3c199f53c93f7b5cabdf815be99adc06ea02 (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);