RSX Bugfixes and plugging memory leaks

BUGFIX: Add break after NV4097_SET_TEXTURE_BORDER_COLOR in RSXThread.cpp
BUGFIX: Fix parameters passed to RSXTexture::SetControl3 (they were being
passed in reverse order)
BUGFIX: Remove invalid, non-sensical call to glPixelStorei in GLGSRender.h
BUGFIX: Fix signed/unsigned comparison compiler warnings in GLGSRender.h
CHANGE: Make GLFragmentProgram::Decompiler synchronous by default
CHANGE: Update wxWidgets submodule to latest commit
BUGFIX: Fix several memory leaks
ADDED: Created a new MSVC debug configuration to output locations
  of allocations that end up leaking after the program
  is closed.
BUGFIX: Fix the stupid PadHandler crash due to the lack of a virtual d'tor
This commit is contained in:
nohbdy 2014-04-15 17:12:15 +03:00
commit d136adc73f
46 changed files with 617 additions and 149 deletions

View file

@ -46,31 +46,38 @@ CPUThread& CPUThreadManager::AddThread(CPUThreadType type)
return *new_thread;
}
//TODO: find out where the thread is actually deleted because it's sure as shit not here
void CPUThreadManager::RemoveThread(const u32 id)
{
std::lock_guard<std::mutex> lock(m_mtx_thread);
for(u32 i=0; i<m_threads.size(); ++i)
CPUThread* thr = nullptr;
u32 thread_index = 0;
for (u32 i = 0; i < m_threads.size(); ++i)
{
if(m_threads[i]->m_wait_thread_id == id)
if (m_threads[i]->m_wait_thread_id == id)
{
m_threads[i]->Wait(false);
m_threads[i]->m_wait_thread_id = -1;
}
if(m_threads[i]->GetId() != id) continue;
if (m_threads[i]->GetId() != id) continue;
CPUThread* thr = m_threads[i];
thr = m_threads[i];
thread_index = i;
}
if (thr)
{
#ifndef QT_UI
wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
thr->Close();
m_threads.erase(m_threads.begin()+ i);
break;
m_threads.erase(m_threads.begin() + thread_index);
}
// Removing the ID should trigger the actual deletion of the thread
Emu.GetIdManager().RemoveID(id);
Emu.CheckStatus();
}