mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
Fix a bug in pstring.cpp causing crash if moved object is reused. (nw)
This commit is contained in:
parent
ee8fed61c2
commit
f61e1f2123
@ -414,6 +414,8 @@ static inline std::size_t countleadbits(std::size_t x)
|
|||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
void pstring_t<F>::sfree(pstr_t *s)
|
void pstring_t<F>::sfree(pstr_t *s)
|
||||||
|
{
|
||||||
|
if (s != nullptr)
|
||||||
{
|
{
|
||||||
bool b = s->dec_and_check();
|
bool b = s->dec_and_check();
|
||||||
if ( b && s != &m_zero)
|
if ( b && s != &m_zero)
|
||||||
@ -427,6 +429,7 @@ void pstring_t<F>::sfree(pstr_t *s)
|
|||||||
plib::pfree_array(reinterpret_cast<char *>(s));
|
plib::pfree_array(reinterpret_cast<char *>(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
pstr_t *pstring_t<F>::salloc(std::size_t n)
|
pstr_t *pstring_t<F>::salloc(std::size_t n)
|
||||||
|
Loading…
Reference in New Issue
Block a user