-
Notifications
You must be signed in to change notification settings - Fork 548
Open
Labels
featureA feature to be implementedA feature to be implemented
Milestone
Description
When a managed wrapper object is Disposed, and then native code later re-exposes the same native handle to managed code, this happens:
Failed to marshal the Objective-C object 0xdeadf00d (type: MyCustomType). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'MyCustomType' does not have a constructor that takes one NativeHandle argument).
I wonder if we could improve diagnostics for this scenario by:
- Setting a flag on in the the NSObject.flags field to indicate a disposed object.
- Keep any disposed objects in the Runtime dictionary of intptr->wrapper mappings, but return a special lookup failure if the object is there, but disposed.
- Show a different error message in this case.
- We could also make it a build-time option to capture a stack trace when Dispose is called too early, and show that stack trace later on in the error message.
EmilienDup
Metadata
Metadata
Assignees
Labels
featureA feature to be implementedA feature to be implemented