chore: do not use new to allocate the pretty printer

This commit is contained in:
Almamu 2025-05-09 03:30:20 +02:00
parent 3806063b01
commit c8124395eb

View File

@ -382,15 +382,13 @@ void CWallpaperApplication::show () {
static struct tm* timeinfo; static struct tm* timeinfo;
if (this->m_context.settings.general.dumpStructure) { if (this->m_context.settings.general.dumpStructure) {
auto* prettyPrinter = new PrettyPrinter::CPrettyPrinter (); auto prettyPrinter = PrettyPrinter::CPrettyPrinter ();
for (const auto& [background, info] : this->m_renderContext->getWallpapers ()) { for (const auto& [background, info] : this->m_renderContext->getWallpapers ()) {
prettyPrinter->printWallpaper (*info); prettyPrinter.printWallpaper (*info);
} }
std::cout << prettyPrinter->str () << std::endl; std::cout << prettyPrinter.str () << std::endl;
delete prettyPrinter;
} }
while (this->m_context.state.general.keepRunning) { while (this->m_context.state.general.keepRunning) {