1
0
Fork 0

capture less when scheduling bundles

This commit is contained in:
Kevin Matz 2023-05-16 09:50:14 -04:00
parent 39bba1f5b0
commit 0398b63907
1 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ void Receiver::dispatch(const std::shared_ptr<Message> msg) const
*/
void Receiver::scheduleBundle(const std::shared_ptr<Bundle> msg) const
{
auto invoke = [&] {
auto invoke = [this] (const std::shared_ptr<Bundle> msg) {
for (const auto &element: msg->elements)
dispatch(element);
};
@ -89,7 +89,7 @@ void Receiver::scheduleBundle(const std::shared_ptr<Bundle> msg) const
* \warning The 64-bit \cite NTPv4 NTP timestamps rollover in 2036. After which all OSC
* Bundles will appear to be in the past and will always be invoked immediately.
*/
invoke();
invoke(msg);
else
{
/**
@ -99,7 +99,7 @@ void Receiver::scheduleBundle(const std::shared_ptr<Bundle> msg) const
*/
std::thread thread([&] {
std::this_thread::sleep_until(time);
invoke();
invoke(msg);
});
thread.detach();
/// \test validate future OSC Bundle scheduling.