summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-12-24 00:19:39 +0000
committerChris Wilson <chris+github@qwirx.com>2015-12-24 00:19:39 +0000
commit0a9a7d262fcd9e796c3b99e66636c093ed46fd33 (patch)
treef7af0f4dee70d5317c56f7cd02a65779f27c5430
parentb52b7d8bbc333a8eeef8fec1f32c191363743d02 (diff)
Catch exceptions during destruction of BackupStoreCheck as well.
Like HousekeepStoreAccount, throwing an exception during the destructor will terminate the application in an "unusual way".
-rw-r--r--lib/backupstore/BackupStoreCheck.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/backupstore/BackupStoreCheck.cpp b/lib/backupstore/BackupStoreCheck.cpp
index bef23f3f..b53ebf6d 100644
--- a/lib/backupstore/BackupStoreCheck.cpp
+++ b/lib/backupstore/BackupStoreCheck.cpp
@@ -84,7 +84,18 @@ BackupStoreCheck::~BackupStoreCheck()
// Avoid an exception if we forget to discard mapNewRefs
if (mapNewRefs.get())
{
- mapNewRefs->Discard();
+ // Discard() can throw exception, but destructors aren't supposed to do that, so
+ // just catch and log them.
+ try
+ {
+ mapNewRefs->Discard();
+ }
+ catch(BoxException &e)
+ {
+ BOX_ERROR("Error while destroying BackupStoreCheck: discarding "
+ "the refcount database threw an exception: " << e.what());
+ }
+
mapNewRefs.reset();
}
}