* Set a terminate() handler to ensure that we leave the BDB
environment cleanly even when an exception is thrown from a destructor. We still crash, but we don't take all other Nix processes with us.
This commit is contained in:
parent
644946feed
commit
cbfac2fdcc
6 changed files with 55 additions and 8 deletions
|
@ -685,8 +685,8 @@ DerivationGoal::~DerivationGoal()
|
|||
try {
|
||||
killChild();
|
||||
deleteTmpDir(false);
|
||||
} catch (Error & e) {
|
||||
printMsg(lvlError, format("error (ignored): %1%") % e.msg());
|
||||
} catch (...) {
|
||||
ignoreException();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -161,7 +161,11 @@ LocalStore::LocalStore(bool reserveSpace)
|
|||
LocalStore::~LocalStore()
|
||||
{
|
||||
/* If the database isn't open, this is a NOP. */
|
||||
nixDB.close();
|
||||
try {
|
||||
nixDB.close();
|
||||
} catch (...) {
|
||||
ignoreException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -148,8 +148,8 @@ RemoteStore::~RemoteStore()
|
|||
fdSocket.close();
|
||||
if (child != -1)
|
||||
child.wait(true);
|
||||
} catch (Error & e) {
|
||||
printMsg(lvlError, format("error (ignored): %1%") % e.msg());
|
||||
} catch (...) {
|
||||
ignoreException();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue