Skip to content

[ffigen] Some objects must be destroyed on the platform thread #1470

@liamappelbe

Description

@liamappelbe

Some ObjC objects can only be used from the platform thread. These objects should also only be destroyed from the platform thread.

We can move our finalizer to the platform thread easily enough, but there's no way of detecting which classes this is necessary for. So there are two options:

  1. Move all objc_release calls to the platform thread. This might have performance implications.
  2. Add config options for this. This would be pretty inconvenient, and if a user didn't know about this feature, or forgot to opt-in one of their classes, they'd get confusing crashes during GC.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions