Skip to content

How to avoid retain cycles when using OSCServer #56

Description

@jcurtis-cc

Hi Devin,

Swift isn't my main language, I'm hoping you could make this clearer for me.

I'm instantiating an OSCServer inside a VC, which I only need while I'm inside that VC. I want to close that connection and deallocate the server when I leave the VC and return to the parent VC.

By making the server.delegate = self I cause a retain cycle even if I try setting server.delegate = nil in viewWilDisappear()

I've tried declaring my server as weak and unowned

What am I missing?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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