# Chapter 5: Self capturing in the continuation

**URL:** <https://forums.kodeco.com/t/chapter-5-self-capturing-in-the-continuation/192448>\
**Category:** Modern Concurrency in Swift\
**Created:** [August 27, 2023, 9:01am UTC](https://forums.kodeco.com/t/chapter-5-self-capturing-in-the-continuation/192448 "2023-08-27T09:01:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexemz](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@lexemz](https://forums.kodeco.com/u/lexemz)\
**Post date:** [August 27, 2023, 9:01am UTC](https://forums.kodeco.com/t/chapter-5-self-capturing-in-the-continuation/192448/1 "2023-08-27T09:01:16Z")

</div>

In the `shareLocation` method, we call `withCheckedThrowingContinuation` method whose closure weakly references `self`. What is the purpose of weakly capturing `self` in this closure if the `manager` is captured strongly?

```swift
func shareLocation() async throws {
    let location: CLLocation = try await
    withCheckedThrowingContinuation { [weak self] continuation in // <- Why weak self?
        self?.delegate = ChatLocationDelegate(manager: manager, continuation: continuation)
        if manager.authorizationStatus == .authorizedWhenInUse {
        manager.startUpdatingLocation()
        }
    }
    ...
}

```

[source](https://github.com/kodecocodes/mcon-materials/blob/editions/2.0/05-intermediate-async-await-and-checkedcontinuation/projects/final/Blabber/Model/BlabberModel.swift#L55-L60)

Xcode 14.3.1 also pays attention to this and displays a warning message

> Reference to property ‘manager’ in closure requires explicit use of ‘self’ to make capture semantics explicit; this is an error in Swift 6
