aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/steve.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/steve.cxx b/src/steve.cxx
index ccbdfe5..4964dab 100644
--- a/src/steve.cxx
+++ b/src/steve.cxx
@@ -781,6 +781,7 @@ static void steve_write(
static void steve_poll(
fuse_req_t req, struct fuse_file_info *fi, struct fuse_pollhandle *ph)
{
+ bool destroy_ph = false;
steve_state *state = static_cast<steve_state *>(fuse_req_userdata(req));
int events = fi->poll_events & (POLLIN | POLLOUT);
@@ -790,7 +791,8 @@ static void steve_poll(
if (ph)
state->waiters.emplace_back(ph, fi->fh);
events &= ~POLLIN;
- }
+ } else
+ destroy_ph = (ph != nullptr);
if (state->verbose) {
const steve_process *process = &state->processes.at(fi->fh);
@@ -803,6 +805,9 @@ static void steve_poll(
}
fuse_reply_poll(req, events);
+
+ if (destroy_ph)
+ fuse_pollhandle_destroy(ph);
}
static void steve_timeout_to_timeval(struct timeval *out, double timeout) {