diff --git a/swift/src/IceImpl/Connection.mm b/swift/src/IceImpl/Connection.mm index fbe38262e77..2c96610f1c4 100644 --- a/swift/src/IceImpl/Connection.mm +++ b/swift/src/IceImpl/Connection.mm @@ -91,7 +91,7 @@ - (BOOL)setCloseCallback:(void (^)(ICEConnection*))callback error:(NSError**)err { if (callback) { - self.connection->setCloseCallback( + self.connection->setCloseCallback( [callback](auto connection) { ICEConnection* conn = [ICEConnection getHandle:connection]; @@ -101,7 +101,6 @@ - (BOOL)setCloseCallback:(void (^)(ICEConnection*))callback error:(NSError**)err callback(conn); } }); - } else {