Skip to content

Commit

Permalink
🤏 Add assert when error occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Nov 22, 2024
1 parent 5fc02e6 commit 1b4cc78
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/no_sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ class ImplPlatform : public no_sleep::internal::Impl {

dbus_pending_call_unref(pending);
dbus_connection_unref(connection);
assert(inhibit_fd >= 0);
}

~ImplPlatform() override
{
if (inhibit_fd >= 0)
close(inhibit_fd);
else
assert(false);
}

ImplPlatform(ImplPlatform const&) = delete;
Expand Down

0 comments on commit 1b4cc78

Please sign in to comment.