mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
hle: kernel: KClientPort: Add an assert for session count.
- Prevents us from over decrementing num_sessions.
This commit is contained in:
parent
ec5674a6ad
commit
b259e95c09
|
@ -28,6 +28,9 @@ void KClientPort::Initialize(KPort* parent_port_, s32 max_sessions_, std::string
|
||||||
void KClientPort::OnSessionFinalized() {
|
void KClientPort::OnSessionFinalized() {
|
||||||
KScopedSchedulerLock sl{kernel};
|
KScopedSchedulerLock sl{kernel};
|
||||||
|
|
||||||
|
// This might happen if a session was improperly used with this port.
|
||||||
|
ASSERT_MSG(num_sessions > 0, "num_sessions is invalid");
|
||||||
|
|
||||||
const auto prev = num_sessions--;
|
const auto prev = num_sessions--;
|
||||||
if (prev == max_sessions) {
|
if (prev == max_sessions) {
|
||||||
this->NotifyAvailable();
|
this->NotifyAvailable();
|
||||||
|
|
Loading…
Reference in a new issue