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
destructor. */
try {
killChild();
} catch (...) {
ignoreExceptionInDestructor();
}
#ifndef _WIN32 // TODO enable `DerivationBuilder` on Windows
if (builder)
builder.reset();

View File

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