Skip to content

Commit c089aaa

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

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-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: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -599,27 +599,28 @@ 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+
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
{
618619
});
619620
}
620621

621622
private:
622-
la::avdecc::ExecutorManager::ExecutorWrapper* _executor;
623+
la::avdecc::ExecutorManager::ExecutorWrapper* _executor{ nullptr };
623624
};
624625
} // namespace
625626

@@ -633,7 +634,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileLoadVirtualEntities)
633634

634635
// Verify if load does not dead lock
635636
auto const future = std::async(std::launch::async,
636-
[this, &controller, flags]()
637+
[&controller, flags]()
637638
{
638639
auto const [error, message] = controller->loadVirtualEntityFromJson("data/SimpleEntity.json", flags);
639640
EXPECT_EQ(la::avdecc::jsonSerializer::DeserializationError::NoError, error);
@@ -657,7 +658,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileUnloadVirtualEntities)
657658

658659
// Verify if unload does not dead lock
659660
auto const future = std::async(std::launch::async,
660-
[this, &controller, flags]()
661+
[&controller]()
661662
{
662663
controller->unloadVirtualEntity(la::avdecc::UniqueIdentifier{ 0x001B92FFFF000001 });
663664
});
@@ -679,7 +680,7 @@ TEST(ControllerEntity, PushJobToExecutorWhileRefreshVirtualEntities)
679680

680681
// Verify if refresh does not dead lock
681682
auto const future = std::async(std::launch::async,
682-
[this, &controller, flags]()
683+
[&controller]()
683684
{
684685
controller->refreshEntity(la::avdecc::UniqueIdentifier{ 0x001B92FFFF000001 });
685686
});

0 commit comments

Comments
 (0)