webview with pdf embedded crashes on dispose

113 views
Skip to first unread message

dries....@gmail.com

unread,
Jan 20, 2014, 3:32:20 AM1/20/14
to cefs...@googlegroups.com
I have a project with cefsharp, where it crashes on the close on the form (only when embedded pdf is used), and the dispose of the webview is called.
I use foxit pdf reader.
To test: I go to this page with my project: http://pdfobject.com/markup/examples/full-browser-window.html
 
The code where it crashes:
        private void Browser_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (_web_view != null) //_web_view = CefSharp.WinForms.WebView
            {
                _web_view.Dispose(); //CRASHES HERE
                _web_view = null;
            }
        }
 
 
What i see there in the close event:
    case WM_CLOSE:
      if (g_handler.get()) {
        CefRefPtr<CefBrowser> browser = g_handler->GetBrowser();
        if (browser.get()) {
          // Let the browser window know we are about to destroy it.
          browser->ParentWindowWillClose();
        }
      }
      break;
 
So I edited the cefsharp.winforms code (WebView.h) in the destructor of the WebView to this and compiled and tried this dll:
        ~WebView()
        {
            CefRefPtr<CefBrowser> browser;
            if (TryGetCefBrowser(browser))
            {
                browser->ParentWindowWillClose(); //I added this line
                browser->CloseBrowser();
            }
        }
 
Still the same error, so it seems like the cefsharp crashes (but the c++ example doesn't) somewhere on the dispose, but I can't find out where...
I alsoo tried using the dll's from the c++ project and use them in my c# project, still the same...

Per Lundberg

unread,
Jan 21, 2014, 2:21:36 AM1/21/14
to cefs...@googlegroups.com
Hi,

Seems a bit tricky. Please make this a formal issue on the GitHub page, we should look into it a bit more. It could be anything unfortunately, but it feels spontaneously like a bug on our behalf...

Best regards,
Per
Reply all
Reply to author
Forward
0 new messages