Skip to content

Commit

Permalink
fix: allocate multitouch interface correctly, fixes #7, fixes #3
Browse files Browse the repository at this point in the history
* also check for the command gate so we don't try to do things after we've already stopped
  • Loading branch information
lazd committed Jan 8, 2020
1 parent fbd2377 commit 9451dbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VoodooI2CGoodix/VoodooI2CGoodixEventDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void VoodooI2CGoodixEventDriver::handleStop(IOService* provider) {
}

IOReturn VoodooI2CGoodixEventDriver::publishMultitouchInterface() {
multitouch_interface = new VoodooI2CMultitouchInterface();
multitouch_interface = OSTypeAlloc(VoodooI2CMultitouchInterface);
if (!multitouch_interface) {
IOLog("%s::No memory to allocate VoodooI2CMultitouchInterface instance\n", getName());
goto multitouch_exit;
Expand Down
4 changes: 4 additions & 0 deletions VoodooI2CGoodix/VoodooI2CGoodixTouchDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ void VoodooI2CGoodixTouchDriver::handle_input_threaded() {
read_in_progress = false;
return;
}
if (!command_gate) {
read_in_progress = false;
return;
}
command_gate->attemptAction(OSMemberFunctionCast(IOCommandGate::Action, this, &VoodooI2CGoodixTouchDriver::goodix_process_events));
read_in_progress = false;
}
Expand Down

0 comments on commit 9451dbe

Please sign in to comment.