Skip to content

Commit

Permalink
fix(client): close devices on DeviceManager#clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Oct 4, 2024
1 parent 099745d commit 3993993
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public interface DeviceManager {
void setInputDevice(@Nullable InputDevice device);

/**
* Removes the output and input devices.
* Closes and removes the output and input devices.
*/
default void clear() {
getOutputDevice().ifPresent(OutputDevice::close);
setOutputDevice(null);
getInputDevice().ifPresent(InputDevice::close);
setInputDevice(null);
}

Expand Down

0 comments on commit 3993993

Please sign in to comment.