## Bug
`cleanup()` modified shared state (`channel_`, `session_`, fd fields) without any mutex. Called from both main thread (connect/disconnect) and IO thread.
## Fix
Added `std::mutex mutex_` and `std::atomic<bool> cleanup_done_` to prevent concurrent cleanup:
```cpp
void SshTerminal::cleanup() {
std::lock_guard<std::mutex> lock(mutex_);
if (cleanup_done_) return;
cleanup_done_ = true;
// ... cleanup resources
}
```
**Status:** Fixed in commit 4a2b2ea
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
cleanup()modified shared state (channel_,session_, fd fields) without any mutex. Called from both main thread (connect/disconnect) and IO thread.Fix
Added
std::mutex mutex_andstd::atomic<bool> cleanup_done_to prevent concurrent cleanup:Status: Fixed in commit
4a2b2ea