Skip to content

Commit 81d58f5

Browse files
committed
refactor: Rename ProxyClient cleanup_it variable
Rename `ProxyClient` constructor `cleanup_it` local variable to `disconnect_cb` to make a bugfix in an upcoming commit more obvious. Reasons for renaming this variable are the same as the ones stated for renaming a similar variable in the previous commit.
1 parent 07230f2 commit 81d58f5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/mp/proxy-io.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ ProxyClientBase<Interface, Impl>::ProxyClientBase(typename Interface::Client cli
393393

394394
{
395395
// Handler for the connection getting destroyed before this client object.
396-
auto cleanup_it = m_context.connection->addSyncCleanup([this]() {
396+
auto disconnect_cb = m_context.connection->addSyncCleanup([this]() {
397397
// Release client capability by move-assigning to temporary.
398398
{
399399
typename Interface::Client(std::move(m_client));
@@ -410,13 +410,13 @@ ProxyClientBase<Interface, Impl>::ProxyClientBase(typename Interface::Client cli
410410
// down while external code is still holding client references.
411411
//
412412
// The first case is handled here when m_context.connection is not null. The
413-
// second case is handled by the cleanup function, which sets m_context.connection to
414-
// null so nothing happens here.
415-
m_context.cleanup_fns.emplace_front([this, destroy_connection, cleanup_it]{
413+
// second case is handled by the disconnect_cb function, which sets
414+
// m_context.connection to null so nothing happens here.
415+
m_context.cleanup_fns.emplace_front([this, destroy_connection, disconnect_cb]{
416416
if (m_context.connection) {
417-
// Remove cleanup callback so it doesn't run and try to access
418-
// this object after it's already destroyed.
419-
m_context.connection->removeSyncCleanup(cleanup_it);
417+
// Remove disconnect callback so it doesn't run and try to access this
418+
// object after it's already destroyed.
419+
m_context.connection->removeSyncCleanup(disconnect_cb);
420420

421421
// If the capnp interface defines a destroy method, call it to destroy
422422
// the remote object, waiting for it to be deleted server side. If the

0 commit comments

Comments
 (0)