[libcalamares] Fix tests failures from JobQueue asserts

Some compile flags changed recently, triggering assert()
in the jobqueue when there is more than one. There's no
real reason for JobQueue to be a singleton, but it wants
to be. So clean up pointers a little more enthusiastically.
This commit is contained in:
Adriaan de Groot 2020-11-01 17:59:41 +01:00
parent 621ac9b8db
commit 0bad5469fc
2 changed files with 4 additions and 1 deletions

View File

@ -249,6 +249,7 @@ JobQueue::~JobQueue()
}
delete m_storage;
s_instance = nullptr;
}

View File

@ -25,6 +25,7 @@ class SmartStatus;
QTEST_GUILESS_MAIN( CreateLayoutsTests )
static CalamaresUtils::Partition::KPMManager* kpmcore = nullptr;
static Calamares::JobQueue* jobqueue = nullptr;
using CalamaresUtils::operator""_MiB;
using CalamaresUtils::operator""_GiB;
@ -39,7 +40,7 @@ CreateLayoutsTests::CreateLayoutsTests()
void
CreateLayoutsTests::init()
{
std::unique_ptr< Calamares::JobQueue > jobqueue_p( new Calamares::JobQueue( nullptr ) );
jobqueue = new Calamares::JobQueue( nullptr );
kpmcore = new CalamaresUtils::Partition::KPMManager();
}
@ -47,6 +48,7 @@ void
CreateLayoutsTests::cleanup()
{
delete kpmcore;
delete jobqueue;
}
void