We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1797bc0 commit 2ac796fCopy full SHA for 2ac796f
mainapp.cpp
@@ -724,9 +724,13 @@ void MainApp::start()
724
const uint32_t delay = (randomish() & 0x0FFF) + 1000;
725
oss << ". Closing after " << delay << " ms.";
726
727
- auto close_f = [fd]()
+ // Queue managed fd so that on SIGHUP, they all get closed when the timers are cleared. A bit clunky to
728
+ // make a shared pointer, but tasks need copyable things.
729
+ std::shared_ptr<FdManaged> fd_managed = std::make_shared<FdManaged>(fd);
730
+
731
+ auto close_f = [fd_managed]()
732
{
- close(fd);
733
+ (void)fd_managed;
734
};
735
736
timed_tasks.addTask(close_f, delay);
0 commit comments