summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/repl_block.cpp5
-rw-r--r--util/optime.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/db/repl_block.cpp b/db/repl_block.cpp
index 43ef9c0b6aa..05be3438650 100644
--- a/db/repl_block.cpp
+++ b/db/repl_block.cpp
@@ -60,7 +60,7 @@ namespace mongo {
Info() : loc(0) {}
~Info() {
if ( loc && owned ) {
- delete[] loc;
+ delete loc;
}
}
bool owned; // true if loc is a pointer of our creation (and not a pointer into a MMF)
@@ -142,8 +142,7 @@ namespace mongo {
}
i.owned = true;
- i.loc = new OpTime[1];
- i.loc[0] = last;
+ i.loc = new OpTime(last);
_dirty = true;
if ( ! _started ) {
diff --git a/util/optime.h b/util/optime.h
index 6eb55abb86c..7e6be4d57de 100644
--- a/util/optime.h
+++ b/util/optime.h
@@ -56,6 +56,10 @@ namespace mongo {
secs = a;
i = b;
}
+ OpTime( const OpTime& other ) {
+ secs = other.secs;
+ i = other.i;
+ }
OpTime() {
secs = 0;
i = 0;