Skip to content

Commit

Permalink
fix segmentation fault
Browse files Browse the repository at this point in the history
(bsdice - abusenius#15)
  • Loading branch information
xeijin committed Jan 6, 2022
1 parent 9e4ef8d commit f6bbca0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/InsaneDaemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ InsaneDaemon::InsaneDaemon()

InsaneDaemon::~InsaneDaemon() noexcept
{
SANE_Handle mHandle2 = mHandle;
log("Exiting...", 1);
close();
try {
mHandle = nullptr;
log("Calling sane_exit", 1);
sane_exit();

if (mHandle2) {
log("Calling sane_exit", 1);
sane_exit();
}
log("Finished", 1);
::close(0);
::close(1);
::close(2);

log("Finished", 1);
} catch (...) {
log("Error calling sane_exit!", 0);
}
Expand Down

0 comments on commit f6bbca0

Please sign in to comment.