Commit 387bfcb
Override CreatePeer for trimmable path, skip GetUninitializedObject
The trimmable path uses proxy.CreateInstance() which creates a fully
initialized peer. Override CreatePeer instead of TryConstructPeer to
bypass the GetUninitializedObject + reflection pattern.
This fixes JavaCast<T> where the pre-allocated shell from
GetUninitializedObject was returned with Handle == IntPtr.Zero
because CreateInstance created a separate object, ignoring the shell.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 3b57107 commit 387bfcb
File tree
1 file changed
+21
-11
lines changed- src/Mono.Android/Microsoft.Android.Runtime
1 file changed
+21
-11
lines changedLines changed: 21 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
508 | 529 | | |
509 | 530 | | |
510 | 531 | | |
511 | 532 | | |
512 | 533 | | |
513 | 534 | | |
514 | 535 | | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| |||
0 commit comments