Delete m_locale in the pgm_base destructor instead of manual destroy method
We need the object in m_locale for a bit more things during program cleanup,
especially on macOS
The destructor of PGM_BASE is sufficient allowance of lifetime.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17369
(cherry picked from commit 9ffa5db667
)
Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
This commit is contained in:
parent
b4ea25dccb
commit
9f1d1fc45e
|
@ -153,6 +153,9 @@ PGM_BASE::~PGM_BASE()
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] m_argvUtf8;
|
delete[] m_argvUtf8;
|
||||||
|
|
||||||
|
delete m_locale;
|
||||||
|
m_locale = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,10 +167,6 @@ void PGM_BASE::Destroy()
|
||||||
sentry_close();
|
sentry_close();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// unlike a normal destructor, this is designed to be called more than once safely:
|
|
||||||
delete m_locale;
|
|
||||||
m_locale = nullptr;
|
|
||||||
|
|
||||||
m_pgm_checker.reset();
|
m_pgm_checker.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue