diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-24 00:19:39 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-24 00:19:39 +0000 |
commit | 0a9a7d262fcd9e796c3b99e66636c093ed46fd33 (patch) | |
tree | f7af0f4dee70d5317c56f7cd02a65779f27c5430 /lib | |
parent | b52b7d8bbc333a8eeef8fec1f32c191363743d02 (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".
Diffstat (limited to 'lib')
-rw-r--r-- | lib/backupstore/BackupStoreCheck.cpp | 13 |
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(); } } |