Only keep reference to the property/method objects long enough to bind the object

No need to store a reference to them long term
This commit is contained in:
amaitland
2015-09-24 19:36:47 +10:00
parent 73c3e515e6
commit 32a9f7fe81
8 changed files with 26 additions and 31 deletions
@@ -12,9 +12,9 @@ namespace CefSharp
{
namespace Async
{
void JavascriptAsyncMethodWrapper::Bind(const CefRefPtr<CefV8Value>& value)
void JavascriptAsyncMethodWrapper::Bind(JavascriptMethod^ method, const CefRefPtr<CefV8Value>& value)
{
auto methodName = StringUtils::ToNative(_method->JavascriptName);
auto methodName = StringUtils::ToNative(method->JavascriptName);
auto v8Function = CefV8Value::CreateFunction(methodName, _javascriptMethodHandler.get());
value->SetValue(methodName, v8Function, V8_PROPERTY_ATTRIBUTE_NONE);