Skip to content

"Never extend the life-time of self from within deinit" #137

@Gargo

Description

@Gargo

https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/commonproblems/

Never extend the life-time of self from within deinit. Doing so will crash at runtime.

I had a code with an object which is created in a background thread (and is destroyed in the same thread because it is default iOS behavior). In the same time the app expects this object being deinited in the main thread.

I didn't have an influence on the thread in which the object inited so I had to delay its deiniting until the main thread. In the same time according to your comments I can't do that. How to resolve it in other way then?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions