Added some extra storage checks to value_t
This commit is contained in:
parent
26ae1fdfad
commit
e2875f47ec
1 changed files with 5 additions and 0 deletions
|
|
@ -211,6 +211,8 @@ private:
|
||||||
void destroy() {
|
void destroy() {
|
||||||
DEBUG("value.storage.refcount", "Destroying " << this);
|
DEBUG("value.storage.refcount", "Destroying " << this);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case VOID:
|
||||||
|
return;
|
||||||
case BALANCE:
|
case BALANCE:
|
||||||
checked_delete(boost::get<balance_t *>(data));
|
checked_delete(boost::get<balance_t *>(data));
|
||||||
break;
|
break;
|
||||||
|
|
@ -220,6 +222,7 @@ private:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
data = false;
|
||||||
type = VOID;
|
type = VOID;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -635,10 +638,12 @@ public:
|
||||||
void set_string(const string& val = "") {
|
void set_string(const string& val = "") {
|
||||||
set_type(STRING);
|
set_type(STRING);
|
||||||
storage->data = val;
|
storage->data = val;
|
||||||
|
VERIFY(boost::get<string>(storage->data) == val);
|
||||||
}
|
}
|
||||||
void set_string(const char * val = "") {
|
void set_string(const char * val = "") {
|
||||||
set_type(STRING);
|
set_type(STRING);
|
||||||
storage->data = string(val);
|
storage->data = string(val);
|
||||||
|
VERIFY(boost::get<string>(storage->data) == val);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_mask() const {
|
bool is_mask() const {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue