projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38ae818
)
fail fast if the delegate was collected prematurely (#56523)
author
Pavel Savara
<pavelsavara@microsoft.com>
Fri, 30 Jul 2021 05:56:22 +0000
(07:56 +0200)
committer
GitHub
<noreply@github.com>
Fri, 30 Jul 2021 05:56:22 +0000
(07:56 +0200)
src/mono/wasm/runtime/binding_support.js
patch
|
blob
|
history
diff --git
a/src/mono/wasm/runtime/binding_support.js
b/src/mono/wasm/runtime/binding_support.js
index
d9d02da
..
85b8944
100644
(file)
--- a/
src/mono/wasm/runtime/binding_support.js
+++ b/
src/mono/wasm/runtime/binding_support.js
@@
-892,6
+892,12
@@
var BindingSupportLib = {
// It's possible the managed object corresponding to this JS object was collected,
// in which case we need to make a new one.
if (!result) {
+
+ if (typeof js_obj.__mono_delegate_alive__ !== "undefined") {
+ console.log("The delegate target that is being invoked is no longer available. Please check if it has been prematurely GC'd.");
+ return null;
+ }
+
delete js_obj.__mono_gchandle__;
delete js_obj.is_mono_bridged_obj;
}