Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Nov 23, 2024
1 parent b65c815 commit 5d7fee4
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions cpp/src/DataStorm/NodeI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ NodeI::createSession(
return; // Shutting down or already connected
}

auto self = shared_from_this();
s->ice_getConnectionAsync(
[=](auto connection) mutable
[=, self = shared_from_this()](auto connection) mutable
{
if (session->checkSession())
{
Expand Down Expand Up @@ -224,7 +223,7 @@ NodeI::createSession(
self->removePublisherSession(*subscriber, session, current_exception());
}
},
[self, subscriber, session](auto ex) { self->removePublisherSession(*subscriber, session, ex); });
[self = shared_from_this(), subscriber, session](auto ex) { self->removePublisherSession(*subscriber, session, ex); });
}
catch (const Ice::LocalException&)
{
Expand Down Expand Up @@ -280,9 +279,8 @@ NodeI::createSubscriberSession(
{
subscriber = getNodeWithExistingConnection(std::move(instance), subscriber, subscriberConnection);

auto self = shared_from_this();
subscriber->ice_getConnectionAsync(
[=](auto connection)
[=, self = shared_from_this()](auto connection)
{
if (connection && !connection->getAdapter())
{
Expand All @@ -293,7 +291,7 @@ NodeI::createSubscriberSession(
nullptr,
[=](auto ex) { self->removePublisherSession(subscriber, session, ex); });
},
[=](auto ex) { self->removePublisherSession(subscriber, session, ex); });
[=, self = shared_from_this()](auto ex) { self->removePublisherSession(subscriber, session, ex); });
}
catch (const Ice::LocalException&)
{
Expand Down Expand Up @@ -328,9 +326,8 @@ NodeI::createPublisherSession(
}
}

auto self = shared_from_this();
p->ice_getConnectionAsync(
[=](auto connection)
[=, self = shared_from_this()](auto connection)
{
if (session->checkSession())
{
Expand All @@ -356,7 +353,7 @@ NodeI::createPublisherSession(
self->removeSubscriberSession(publisher, session, current_exception());
}
},
[=](exception_ptr ex) { self->removeSubscriberSession(publisher, session, ex); });
[=, self = shared_from_this()](exception_ptr ex) { self->removeSubscriberSession(publisher, session, ex); });
}
catch (const Ice::LocalException&)
{
Expand Down

0 comments on commit 5d7fee4

Please sign in to comment.