[persistent-data/block] ::exit() if write_ref drops below zero
We were throwing before, which obviously isn't allowed in a destructor.
This commit is contained in:
parent
4493d6d39d
commit
73ae456175
@ -188,8 +188,10 @@ namespace persistent_data {
|
|||||||
block_manager<BlockSize>::write_ref::~write_ref()
|
block_manager<BlockSize>::write_ref::~write_ref()
|
||||||
{
|
{
|
||||||
if (ref_count_) {
|
if (ref_count_) {
|
||||||
if (!*ref_count_)
|
if (!*ref_count_) {
|
||||||
throw std::runtime_error("write_ref ref_count going below zero");
|
std::cerr << "write_ref ref_count going below zero";
|
||||||
|
::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
(*ref_count_)--;
|
(*ref_count_)--;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user