1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Correct FrameBufferList::removeBuffer and FrameBufferList::removeBuffer -

null current buffer if removed buffer is the current one.
This commit is contained in:
Sergey Lipskiy 2015-04-02 15:43:57 +06:00
parent 4569c8beb8
commit b136d05a3d

View File

@ -428,7 +428,7 @@ void FrameBufferList::removeBuffer(u32 _address )
{
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
if (iter->m_startAddress == _address) {
if (m_pCurrent != NULL && m_pCurrent->m_startAddress == _address)
if (&(*iter) == m_pCurrent)
m_pCurrent = NULL;
m_list.erase(iter);
return;
@ -440,6 +440,8 @@ void FrameBufferList::removeBuffers(u32 _width)
m_pCurrent = NULL;
for (FrameBuffers::iterator iter = m_list.begin(); iter != m_list.end(); ++iter) {
while (iter->m_width == _width) {
if (&(*iter) == m_pCurrent)
m_pCurrent = NULL;
iter = m_list.erase(iter);
if (iter == m_list.end())
return;