mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
hidbus/ringcon: Fixed cleanup, this also fixed a crash.
This commit is contained in:
parent
9a1e3aeb47
commit
bcc0f86aa3
@ -95,6 +95,7 @@ Result ringconCreate(RingCon *c, HidControllerID id) {
|
||||
|
||||
void ringconClose(RingCon *c) {
|
||||
if (c->bus_initialized) {
|
||||
c->bus_initialized = false;
|
||||
// Official sw uses hidbusDisableJoyPollingReceiveMode here, but that's redundant since hidbusEnableExternalDevice with flag=false uses that automatically.
|
||||
hidbusEnableExternalDevice(c->handle, false, 0x20);
|
||||
hidbusFinalize(c->handle);
|
||||
|
@ -279,6 +279,7 @@ Result hidbusFinalize(HidbusBusHandle handle) {
|
||||
|
||||
if (R_SUCCEEDED(rc)) rc = _hidbusInBusHandleResIdNoOut(&srv, handle, 4); // Finalize
|
||||
eventClose(&entry->event);
|
||||
memset(&entry->handle, 0, sizeof(entry->handle));
|
||||
|
||||
_hidbusSharedmemExit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user