Skip to content

Commit ce305d7

Browse files
committed
Fixes after code review
1 parent c7214c4 commit ce305d7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/controller/avdeccControllerImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7053,7 +7053,7 @@ void ControllerImpl::runJobOnExecutorAndWait(la::avdecc::ExecutorManager& execut
70537053
{
70547054
// Ready to advertise using the network executor
70557055
executor.pushJob(exName,
7056-
[this, job]()
7056+
[this, job = std::move(job)]()
70577057
{
70587058
auto const lg = std::lock_guard{ *_controller }; // Lock the Controller itself (thus, lock it's ProtocolInterface), since we are on the Networking Thread
70597059
job();

src/controller/avdeccControllerImpl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ class ControllerImpl final : public Controller, private entity::controller::Dele
807807
return ControlledEntityImplGuard{ std::move(entity), locked };
808808
}
809809

810-
void runJobOnExecutorAndWait(la::avdecc::ExecutorManager& executor, const std::string& exName, Executor::Job&& job) const noexcept;
810+
void runJobOnExecutorAndWait(la::avdecc::ExecutorManager& executor, std::string const& exName, Executor::Job&& job) const noexcept;
811811

812812
/* ************************************************************ */
813813
/* Private members */

tests/src/controller/avdeccControlledEntity_tests.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,27 +599,29 @@ class JobPusherObserver : public la::avdecc::controller::Controller::DefaultedOb
599599
{
600600
public:
601601
JobPusherObserver(la::avdecc::ExecutorManager::ExecutorWrapper* executor)
602-
: _executor(executor)
602+
: _executor{ executor }
603603
{
604604
}
605605
virtual void onEntityOnline(la::avdecc::controller::Controller const* const /* controller */, la::avdecc::controller::ControlledEntity const* const /* entity*/) noexcept override
606606
{
607607
_executor->pushJob(
608-
[this]()
608+
[]()
609609
{
610+
// Empty, just to force a job in the queue
610611
});
611612
}
612613

613614
virtual void onEntityOffline(la::avdecc::controller::Controller const* const /* controller */, la::avdecc::controller::ControlledEntity const* const /* entity */) noexcept override
614615
{
615616
_executor->pushJob(
616-
[this]()
617+
[]()
617618
{
619+
// Empty, just to force a job in the queue
618620
});
619621
}
620622

621623
private:
622-
la::avdecc::ExecutorManager::ExecutorWrapper* _executor;
624+
la::avdecc::ExecutorManager::ExecutorWrapper* const _executor{ nullptr };
623625
};
624626
} // namespace
625627

@@ -633,7 +635,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileLoadVirtualEntities)
633635

634636
// Verify if load does not dead lock
635637
auto const future = std::async(std::launch::async,
636-
[this, &controller, flags]()
638+
[&controller, flags]()
637639
{
638640
auto const [error, message] = controller->loadVirtualEntityFromJson("data/SimpleEntity.json", flags);
639641
EXPECT_EQ(la::avdecc::jsonSerializer::DeserializationError::NoError, error);
@@ -657,7 +659,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileUnloadVirtualEntities)
657659

658660
// Verify if unload does not dead lock
659661
auto const future = std::async(std::launch::async,
660-
[this, &controller, flags]()
662+
[&controller]()
661663
{
662664
controller->unloadVirtualEntity(la::avdecc::UniqueIdentifier{ 0x001B92FFFF000001 });
663665
});
@@ -679,7 +681,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileRefreshVirtualEntities)
679681

680682
// Verify if refresh does not dead lock
681683
auto const future = std::async(std::launch::async,
682-
[this, &controller, flags]()
684+
[&controller]()
683685
{
684686
controller->refreshEntity(la::avdecc::UniqueIdentifier{ 0x001B92FFFF000001 });
685687
});

0 commit comments

Comments
 (0)