1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Move killChild call from ~DerivationBuildingGoal to ~DerivationBuilder

Sadly we cannot unexpose `DerivationBuilder::killChild` yet, because
`DerivationBuildingGoal` calls it elsewhere, but we can at least haave a
better division of labor between the two destructors.
This commit is contained in:
John Ericson 2025-08-28 13:57:38 -04:00
parent c632c823ce
commit bde745cb3f
2 changed files with 5 additions and 5 deletions

View file

@ -53,11 +53,6 @@ DerivationBuildingGoal::~DerivationBuildingGoal()
{ {
/* Careful: we should never ever throw an exception from a /* Careful: we should never ever throw an exception from a
destructor. */ destructor. */
try {
killChild();
} catch (...) {
ignoreExceptionInDestructor();
}
#ifndef _WIN32 // TODO enable `DerivationBuilder` on Windows #ifndef _WIN32 // TODO enable `DerivationBuilder` on Windows
if (builder) if (builder)
builder.reset(); builder.reset();

View file

@ -94,6 +94,11 @@ public:
{ {
/* Careful: we should never ever throw an exception from a /* Careful: we should never ever throw an exception from a
destructor. */ destructor. */
try {
killChild();
} catch (...) {
ignoreExceptionInDestructor();
}
try { try {
stopDaemon(); stopDaemon();
} catch (...) { } catch (...) {