Skip to content

Commit e534fe0

Browse files
committed
changed some comments
1 parent 08c62b4 commit e534fe0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

documentation/cxx-interop/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ To specify the ownership of returned `SWIFT_SHARED_REFERENCE` types, use the `SW
12611261
// Returns +1 ownership; Swift will take responsibility for releasing it.
12621262
SharedObject* makeOwnedObject() SWIFT_RETURNS_RETAINED;
12631263

1264-
// Returns +0 ownership; the caller must ensure the object stays alive.
1264+
// Returns +0 ownership; the caller must ensure the object stays alive by retaining it before use.
12651265
SharedObject* makeUnownedObject() SWIFT_RETURNS_UNRETAINED;
12661266
```
12671267

@@ -1271,12 +1271,12 @@ let owned = makeOwnedObject()
12711271
owned.doSomething()
12721272
// `owned` is automatically released when it goes out of scope
12731273

1274-
let unowned = makeUnownedObject()
1275-
unowned.doSomething()
1276-
// make sure `unowned` remains valid while in use
1274+
let unOwned = makeUnownedObject()
1275+
unOwned.doSomething()
1276+
// Swift makes sure `unOwned` remains valid while in use by calling an explicit retain operation.
12771277
```
12781278

1279-
These ownership annotations are also supported in Objective-C or Objective-C++ functions that return C++ `SWIFT_SHARED_REFERENCE` types.
1279+
These ownership annotations are also supported in Objective-C++ functions that return C++ `SWIFT_SHARED_REFERENCE` types.
12801280

12811281

12821282
### Inheritance and Virtual Member Functions

0 commit comments

Comments
 (0)