mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-05 19:54:53 +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:
@@ -12,7 +12,7 @@ using namespace System;
|
||||
|
||||
namespace CefSharp
|
||||
{
|
||||
void JavascriptPropertyWrapper::Bind()
|
||||
void JavascriptPropertyWrapper::Bind(const CefRefPtr<CefV8Value>& v8Value, JavascriptCallbackRegistry^ callbackRegistry)
|
||||
{
|
||||
auto propertyName = StringUtils::ToNative(_javascriptProperty->JavascriptName);
|
||||
auto clrPropertyName = _javascriptProperty->JavascriptName;
|
||||
@@ -20,8 +20,7 @@ namespace CefSharp
|
||||
if (_javascriptProperty->IsComplexType)
|
||||
{
|
||||
auto javascriptObjectWrapper = gcnew JavascriptObjectWrapper(_javascriptProperty->JsObject, _browserProcess);
|
||||
javascriptObjectWrapper->V8Value = V8Value.get();
|
||||
javascriptObjectWrapper->Bind();
|
||||
javascriptObjectWrapper->Bind(v8Value, callbackRegistry);
|
||||
|
||||
_javascriptObjectWrapper = javascriptObjectWrapper;
|
||||
}
|
||||
@@ -29,7 +28,7 @@ namespace CefSharp
|
||||
{
|
||||
auto propertyAttribute = _javascriptProperty->IsReadOnly ? V8_PROPERTY_ATTRIBUTE_READONLY : V8_PROPERTY_ATTRIBUTE_NONE;
|
||||
|
||||
V8Value->SetValue(propertyName, V8_ACCESS_CONTROL_DEFAULT, propertyAttribute);
|
||||
v8Value->SetValue(propertyName, V8_ACCESS_CONTROL_DEFAULT, propertyAttribute);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user