mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-27 22:02:25 -06:00
Fix UB
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.6, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.6, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.6, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Reference exists after destructor is called.
This commit is contained in:
parent
208c4e2af2
commit
3f2075070a
@ -107,13 +107,8 @@ struct cross_controller
|
||||
|
||||
void stop_thread()
|
||||
{
|
||||
if (connection_thread)
|
||||
{
|
||||
auto& thread = *connection_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
connection_thread.reset();
|
||||
}
|
||||
// Join thread
|
||||
connection_thread.reset();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -828,13 +828,8 @@ void rec_info::stop_video_provider(bool flush)
|
||||
{
|
||||
cellRec.notice("Stopping video provider.");
|
||||
|
||||
if (video_provider_thread)
|
||||
{
|
||||
auto& thread = *video_provider_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
video_provider_thread.reset();
|
||||
}
|
||||
// Join thread
|
||||
video_provider_thread.reset();
|
||||
|
||||
// Flush the ringbuffer if necessary.
|
||||
// This should only happen if the video sink is not the encoder itself.
|
||||
|
||||
@ -59,13 +59,7 @@ struct sce_np_util_manager
|
||||
|
||||
void join_thread()
|
||||
{
|
||||
if (bandwidth_test_thread)
|
||||
{
|
||||
auto& thread = *bandwidth_test_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
bandwidth_test_thread.reset();
|
||||
}
|
||||
bandwidth_test_thread.reset();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -88,14 +88,8 @@ static void clear_sdl_joysticks(std::map<u64, std::vector<SDL_Joystick*>>& joyst
|
||||
|
||||
usb_device_logitech_g27::~usb_device_logitech_g27()
|
||||
{
|
||||
// wait for the house keeping thread to finish
|
||||
if (m_house_keeping_thread)
|
||||
{
|
||||
auto& thread = *m_house_keeping_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
m_house_keeping_thread.reset();
|
||||
}
|
||||
// Wait for the house keeping thread to finish
|
||||
m_house_keeping_thread.reset();
|
||||
|
||||
// Close sdl handles
|
||||
{
|
||||
|
||||
@ -47,13 +47,8 @@ gui_pad_thread::gui_pad_thread()
|
||||
|
||||
gui_pad_thread::~gui_pad_thread()
|
||||
{
|
||||
if (m_thread)
|
||||
{
|
||||
auto& thread = *m_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
m_thread.reset();
|
||||
}
|
||||
// Join thread
|
||||
m_thread.reset();
|
||||
|
||||
#ifdef __linux__
|
||||
if (m_uinput_fd != 1)
|
||||
|
||||
@ -101,12 +101,8 @@ hid_pad_handler<Device>::hid_pad_handler(pad_handler type, std::vector<id_pair>
|
||||
template <class Device>
|
||||
hid_pad_handler<Device>::~hid_pad_handler()
|
||||
{
|
||||
if (m_enumeration_thread)
|
||||
{
|
||||
auto& enumeration_thread = *m_enumeration_thread;
|
||||
enumeration_thread = thread_state::aborting;
|
||||
enumeration_thread();
|
||||
}
|
||||
// Join thread
|
||||
m_enumeration_thread.reset();
|
||||
|
||||
for (auto& controller : m_controllers)
|
||||
{
|
||||
|
||||
@ -309,13 +309,10 @@ void pad_thread::operator()()
|
||||
|
||||
for (auto& thread : threads)
|
||||
{
|
||||
if (thread)
|
||||
{
|
||||
auto& enumeration_thread = *thread;
|
||||
enumeration_thread = thread_state::aborting;
|
||||
enumeration_thread();
|
||||
}
|
||||
// Join thread (ordered explicitly)
|
||||
thread.reset();
|
||||
}
|
||||
|
||||
threads.clear();
|
||||
|
||||
input_log.notice("Pad threads stopped");
|
||||
|
||||
@ -277,13 +277,8 @@ void raw_mouse::update_values(s32 scan_code, bool pressed)
|
||||
|
||||
raw_mouse_handler::~raw_mouse_handler()
|
||||
{
|
||||
if (m_thread)
|
||||
{
|
||||
auto& thread = *m_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
m_thread.reset();
|
||||
}
|
||||
// Join thread
|
||||
m_thread.reset();
|
||||
|
||||
#ifdef _WIN32
|
||||
unregister_raw_input_devices();
|
||||
|
||||
@ -231,13 +231,9 @@ pad_motion_settings_dialog::pad_motion_settings_dialog(QDialog* parent, std::sha
|
||||
|
||||
pad_motion_settings_dialog::~pad_motion_settings_dialog()
|
||||
{
|
||||
if (m_input_thread)
|
||||
{
|
||||
m_input_thread_state = input_thread_state::pausing;
|
||||
auto& thread = *m_input_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
}
|
||||
// Join thread
|
||||
m_input_thread_state = input_thread_state::pausing;
|
||||
m_input_thread.reset();
|
||||
}
|
||||
|
||||
void pad_motion_settings_dialog::change_device(int index)
|
||||
|
||||
@ -269,13 +269,8 @@ ps_move_tracker_dialog::~ps_move_tracker_dialog()
|
||||
m_camera_handler->close_camera();
|
||||
}
|
||||
|
||||
if (m_input_thread)
|
||||
{
|
||||
auto& thread = *m_input_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
m_input_thread.reset();
|
||||
}
|
||||
// Join thread
|
||||
m_input_thread.reset();
|
||||
}
|
||||
|
||||
void ps_move_tracker_dialog::update_color(bool update_sliders)
|
||||
|
||||
@ -827,10 +827,7 @@ namespace utils
|
||||
}
|
||||
}
|
||||
|
||||
auto& thread = *m_thread;
|
||||
thread = thread_state::aborting;
|
||||
thread();
|
||||
|
||||
// Join thread
|
||||
m_thread.reset();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user