Code Monkey home page Code Monkey logo

Comments (6)

ataranto avatar ataranto commented on August 27, 2024

Yeah, good find. We should probably block JS execution once Dispose begins.

On , Jack O'Connor
[email protected]
wrote:


> CefSharp.dll!CefSharp::ScriptCore::UIT_Execute(CefRefPtr* browser,  
CefStringBase* script) Line 10 C++

[External Code]

CefSharp.dll!DispatchToMethod,CefStringBase),CefRefPtr,CefStringBase  
>(CefSharp::ScriptCore* obj, void* method, Tuple2,CefStringBase >& arg)  
Line 592 C++

CefSharp.dll!CefRunnableMethod,CefStringBase),Tuple2,CefStringBase >  
>::Execute(cef_thread_id_t threadId) Line 151 C++

[External Code]

This occurs when an ExecuteScript call is made right before the app
exits, so presumably the WinForms browser is getting disposed out from
under us. Is there a good way to protect ourselves from this error?
Alternatively, should we do something like check for null here in
UIT_Execute?

Exception


Reply to this email directly or view it on GitHub:

#24

from cefsharp.

ataranto avatar ataranto commented on August 27, 2024

On second though, we probably need something more similar to the TryGetCefBrowser() pattern used within the WebView classes:

https://github.com/ataranto/CefSharp/blob/master/CefSharp.Wpf/WebView.cpp#L42

from cefsharp.

oconnor663 avatar oconnor663 commented on August 27, 2024

Working from your suggestion, this looks like it solves the problem. How does it look to you?

https://github.com/oconnor663/CefSharp/commit/e595b4ff1dccc73d90ad24cdf96b291fb7e13d9c

from cefsharp.

ataranto avatar ataranto commented on August 27, 2024

Yeah, looks great. I may try to make a general TryGet* internal api. Also, I might make Evaluate throw an exception, which right now is how consumers are notified that "your script didn't run successfully" .

from cefsharp.

oconnor663 avatar oconnor663 commented on August 27, 2024

Do you want to merge the diff as it is now, or make changes first?

from cefsharp.

ataranto avatar ataranto commented on August 27, 2024

I will probably merge it as is for now. I want to make some time this weekend to merge in a bunch of contributions and make a release, there are lots of great changes/fixes that are only on other people's branches right now, so i want to get them merged before there's more fragmentation.

from cefsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.