Copy weak reference to callback object when dispatching calls to Java
Summary: The bridge could be destructed, meaning we can't try to resolve member variables of PlatformBridgeCallback. Reviewed By: lexs Differential Revision: D3005994 fb-gh-sync-id: f83de432148ce62fd1060c6b84ec39ad2fa10a55 shipit-source-id: f83de432148ce62fd1060c6b84ec39ad2fa10a55
This commit is contained in:
parent
32dd1fe35a
commit
7fb33032f6
|
@ -629,13 +629,13 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
auto runnableWrapper = std::bind([this] (std::function<void(ResolvedWeakReference&)>& runnable) {
|
||||
auto runnableWrapper = std::bind([weakCallback=weakCallback_] (std::function<void(ResolvedWeakReference&)>& runnable) {
|
||||
auto env = Environment::current();
|
||||
if (env->ExceptionCheck()) {
|
||||
FBLOGW("Dropped calls because of pending exception");
|
||||
return;
|
||||
}
|
||||
ResolvedWeakReference callback(weakCallback_);
|
||||
ResolvedWeakReference callback(weakCallback);
|
||||
if (callback) {
|
||||
runnable(callback);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue