mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +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) {
|
void ringconClose(RingCon *c) {
|
||||||
if (c->bus_initialized) {
|
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.
|
// Official sw uses hidbusDisableJoyPollingReceiveMode here, but that's redundant since hidbusEnableExternalDevice with flag=false uses that automatically.
|
||||||
hidbusEnableExternalDevice(c->handle, false, 0x20);
|
hidbusEnableExternalDevice(c->handle, false, 0x20);
|
||||||
hidbusFinalize(c->handle);
|
hidbusFinalize(c->handle);
|
||||||
|
@ -279,6 +279,7 @@ Result hidbusFinalize(HidbusBusHandle handle) {
|
|||||||
|
|
||||||
if (R_SUCCEEDED(rc)) rc = _hidbusInBusHandleResIdNoOut(&srv, handle, 4); // Finalize
|
if (R_SUCCEEDED(rc)) rc = _hidbusInBusHandleResIdNoOut(&srv, handle, 4); // Finalize
|
||||||
eventClose(&entry->event);
|
eventClose(&entry->event);
|
||||||
|
memset(&entry->handle, 0, sizeof(entry->handle));
|
||||||
|
|
||||||
_hidbusSharedmemExit();
|
_hidbusSharedmemExit();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user