mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-16 16:21:02 +00:00
overlays: Fixup
- Avoid calling join on self thread. - Avoid use-after-free.
This commit is contained in:
parent
e45360de2b
commit
54da9ac7e5
@ -232,14 +232,18 @@ namespace rsx
|
|||||||
std::scoped_lock lock(m_threadpool_mutex);
|
std::scoped_lock lock(m_threadpool_mutex);
|
||||||
if (!exit)
|
if (!exit)
|
||||||
{
|
{
|
||||||
m_workers.emplace_back([&]
|
m_workers.emplace_back([&]()
|
||||||
{
|
{
|
||||||
if (interactive)
|
if (interactive)
|
||||||
{
|
{
|
||||||
|
auto ref = g_fxo->get<display_manager>()->get(uid);
|
||||||
|
|
||||||
if (auto error = run_input_loop())
|
if (auto error = run_input_loop())
|
||||||
{
|
{
|
||||||
rsx_log.error("Dialog input loop exited with error code=%d", error);
|
rsx_log.error("Dialog input loop exited with error code=%d", error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verify(HERE), ref.get() == static_cast<overlay*>(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -317,10 +317,26 @@ namespace rsx
|
|||||||
reader_lock lock(m_threadpool_mutex);
|
reader_lock lock(m_threadpool_mutex);
|
||||||
for (auto& worker : m_workers)
|
for (auto& worker : m_workers)
|
||||||
{
|
{
|
||||||
worker.join();
|
if (std::this_thread::get_id() != worker.get_id() && worker.joinable())
|
||||||
|
{
|
||||||
|
worker.join();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
worker.detach();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pad::SetIntercepted(false);
|
||||||
|
|
||||||
|
if (on_close && use_callback)
|
||||||
|
{
|
||||||
|
g_last_user_response = return_code;
|
||||||
|
on_close(return_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE: Object removal should be the last step
|
||||||
if (auto manager = g_fxo->get<display_manager>())
|
if (auto manager = g_fxo->get<display_manager>())
|
||||||
{
|
{
|
||||||
if (auto dlg = manager->get<rsx::overlays::message_dialog>())
|
if (auto dlg = manager->get<rsx::overlays::message_dialog>())
|
||||||
@ -331,14 +347,6 @@ namespace rsx
|
|||||||
|
|
||||||
manager->remove(uid);
|
manager->remove(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
pad::SetIntercepted(false);
|
|
||||||
|
|
||||||
if (on_close && use_callback)
|
|
||||||
{
|
|
||||||
g_last_user_response = return_code;
|
|
||||||
on_close(return_code);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void overlay::refresh()
|
void overlay::refresh()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user