mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
Cleanup Binding, rather than keep references to the V8 objects, just use them and then let them be released
Code should be a little easier to debug now.
This commit is contained in:
@@ -9,17 +9,20 @@
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
void JavascriptRootObjectWrapper::Bind()
|
||||
void JavascriptRootObjectWrapper::Bind(const CefRefPtr<CefV8Value>& v8Value)
|
||||
{
|
||||
auto memberObjects = _rootObject->MemberObjects;
|
||||
for each (JavascriptObject^ obj in Enumerable::OfType<JavascriptObject^>(memberObjects))
|
||||
{
|
||||
auto wrapperObject = gcnew JavascriptObjectWrapper(obj, _browserProcess);
|
||||
wrapperObject->CallbackRegistry = CallbackRegistry;
|
||||
wrapperObject->V8Value = V8Value.get();
|
||||
wrapperObject->Bind();
|
||||
wrapperObject->Bind(v8Value, _callbackRegistry);
|
||||
|
||||
_wrappedObjects->Add(wrapperObject);
|
||||
}
|
||||
}
|
||||
|
||||
JavascriptCallbackRegistry^ JavascriptRootObjectWrapper::CallbackRegistry::get()
|
||||
{
|
||||
return _callbackRegistry;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user