mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-27 12:18:35 +01:00
http: Avoid detach() in webserver code.
Should make debugger server more viable on Switch. Also fixes a leak.
This commit is contained in:
1 parent
cb1b7b1e43
commit
11e828053b
4 files changed
+19
-2
No files matched your search
@@ -10,7 +10,13 @@ void SameThreadExecutor::Run(std::function<void()> func) {
|
||||
}
|
||||
|
||||
void NewThreadExecutor::Run(std::function<void()> func) {
|
||||
std::thread(func).detach();
|
||||
thread_ = std::thread(func);
|
||||
}
|
||||
|
||||
NewThreadExecutor::~NewThreadExecutor() {
|
||||
// If Run was ever called...
|
||||
if (thread_.joinable())
|
||||
thread_.join();
|
||||
}
|
||||
|
||||
} // namespace threading
|
||||
Reference in new issue
Block a user