Skip to content

Commit

Permalink
Fix #79551
Browse files Browse the repository at this point in the history
Refactor debug file management by replacing destructor call with explicit deinitialization method
  • Loading branch information
alef committed Feb 6, 2025
1 parent bfaee8a commit 4492703
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ struct OutputDebugStreamA : public std::ostream {
#endif

struct DebugFile {
~DebugFile();
void init( DebugOutput, const cata_path &filename );
void deinit();
std::ostream &get_file();
static DebugFile &instance() {
static DebugFile instance;
Expand All @@ -720,7 +720,7 @@ struct DebugFile {
// DebugFile OStream Wrapper {{{2
// ---------------------------------------------------------------------

DebugFile::~DebugFile()
void DebugFile::deinit()
{
if( file && file.get() != &std::cerr ) {
output_repetitions( *file );
Expand Down Expand Up @@ -836,7 +836,7 @@ void setupDebug( DebugOutput output_mode )

void deinitDebug()
{
DebugFile::instance().~DebugFile();
DebugFile::instance().deinit();
}

// OStream Operators {{{2
Expand Down

0 comments on commit 4492703

Please sign in to comment.