Skip to content

Commit 9451dbe

Browse files
committed
fix: allocate multitouch interface correctly, fixes #7, fixes #3
* also check for the command gate so we don't try to do things after we've already stopped
1 parent fbd2377 commit 9451dbe

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

VoodooI2CGoodix/VoodooI2CGoodixEventDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ void VoodooI2CGoodixEventDriver::handleStop(IOService* provider) {
203203
}
204204

205205
IOReturn VoodooI2CGoodixEventDriver::publishMultitouchInterface() {
206-
multitouch_interface = new VoodooI2CMultitouchInterface();
206+
multitouch_interface = OSTypeAlloc(VoodooI2CMultitouchInterface);
207207
if (!multitouch_interface) {
208208
IOLog("%s::No memory to allocate VoodooI2CMultitouchInterface instance\n", getName());
209209
goto multitouch_exit;

VoodooI2CGoodix/VoodooI2CGoodixTouchDriver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ void VoodooI2CGoodixTouchDriver::handle_input_threaded() {
235235
read_in_progress = false;
236236
return;
237237
}
238+
if (!command_gate) {
239+
read_in_progress = false;
240+
return;
241+
}
238242
command_gate->attemptAction(OSMemberFunctionCast(IOCommandGate::Action, this, &VoodooI2CGoodixTouchDriver::goodix_process_events));
239243
read_in_progress = false;
240244
}

0 commit comments

Comments
 (0)