Skip to content

Commit

Permalink
ToucheggClient: Set timeout event source ID to null after usage
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseExposito committed Oct 8, 2023
1 parent 1e70824 commit fd2300f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/touchegg/ToucheggClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,15 @@ const ToucheggClient = GObject.registerClass({
}

static async sleep(time) {
const timeoutId = await new Promise((resolve) => {
let timeoutId = await new Promise((resolve) => {
const ret = GLib.timeout_add(GLib.PRIORITY_DEFAULT, time, () => {
resolve(ret);
return GLib.SOURCE_REMOVE;
});
});

GLib.source_remove(timeoutId);
timeoutId = null;
}

onNewMessage(connection, senderName, objectPath, interfaceName, signalName, parameters) {
Expand Down

0 comments on commit fd2300f

Please sign in to comment.