Skip to content

Commit

Permalink
LegacyBinding - Remove objects from cache if key already exists
Browse files Browse the repository at this point in the history
Temp fix for #2301 Will be resolved properly in #2306
  • Loading branch information
amaitland committed Apr 20, 2018
1 parent 7490b53 commit f6e5828
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CefSharp.BrowserSubprocess.Core/CefAppUnmanagedWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,16 @@ namespace CefSharp

for each (JavascriptObject^ obj in Enumerable::OfType<JavascriptObject^>(javascriptObjects))
{
//Using LegacyBinding with multiple ChromiumWebBrowser instances that share the same
//render process and using LegacyBinding will cause problems for the limited caching implementation
//that exists at the moment, for now we'll remove an object if already exists, same behaviour
//as the new binding method.
//TODO: This should be removed when https://github.com/cefsharp/CefSharp/issues/2306
//Is complete as objects will be stored at the browser level
if (_javascriptObjects->ContainsKey(obj->JavascriptName))
{
_javascriptObjects->Remove(obj->JavascriptName);
}
_javascriptObjects->Add(obj->JavascriptName, obj);
}
}
Expand Down

0 comments on commit f6e5828

Please sign in to comment.