mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SafeThread: Avoid use-after-free risk in thread shutdown (#1355)
Use shared_ptr to keep data alive until the thread has terminated.
This commit is contained in:
@@ -39,7 +39,7 @@ class EventLoopRunner::Thread : public SafeThread {
|
||||
std::weak_ptr<UvExecFunc> m_doExec;
|
||||
};
|
||||
|
||||
EventLoopRunner::EventLoopRunner() { m_owner.Start(new Thread); }
|
||||
EventLoopRunner::EventLoopRunner() { m_owner.Start(); }
|
||||
|
||||
EventLoopRunner::~EventLoopRunner() {
|
||||
ExecAsync([](uv::Loop& loop) {
|
||||
|
||||
Reference in New Issue
Block a user