Open Bug 1960916 Opened 1 month ago Updated 29 days ago

Release callback interface handles in the face of lowering errors

Categories

(Toolkit :: UniFFI Bindings, enhancement)

enhancement

Tracking

()

ASSIGNED

People

(Reporter: bdk, Assigned: bdk)

Details

(Whiteboard: [uniffi-])

Attachments

(1 file)

We currently have code that frees object handles in the face of lowering errors (the generated FfiValueObjectHandle* classes). We should do the same thing for callback interfaces. If there's an error during the lowering process and we've already lowered a callback interface handle, then we should arrange it so that handle is destroyed.

Assignee: nobody → bdeankawamura
Status: NEW → ASSIGNED

Added a new FfiValue type for callback interfaces. This works like the
u64 one, except it has extra code to cleanup leftover handles if
lowering fails.

Added the UniffiSkipJsTypeCheck class, which can be used to skip the
JS type checking in the xpcshell tests. This was the only way I could
think of to test this new code.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: