SendProcessMessage - who is responsible for disposing args?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

SendProcessMessage - who is responsible for disposing args?

Postby Tsury » Thu Oct 01, 2015 4:00 am

I am sending a lot of messages from the renderer to the browser and vice-versa, sometimes with lists of arguments.
Who is responsible to dispose of the arguments in which case (renderer -> browser, browser -> renderer), and when can the arguments be safely disposed?

I am using CefGlue in a very big project, and sometimes there will be a crash when disposing of a CefListValue:

There's even someone mentioning this crash here: https://groups.google.com/forum/#!topic ... XZNBfVIxqA

Code: Select all
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at
Xilium.CefGlue.Interop.cef_list_value_t.release_delegate.Invoke(cef_list_value_t* self) at
Xilium.CefGlue.Interop.cef_list_value_t.release(cef_list_value_t* self) at
Xilium.CefGlue.CefListValue.Release() at
Xilium.CefGlue.CefListValue.Finalize()
Tsury
Mentor
 
Posts: 63
Joined: Mon Jan 19, 2015 4:31 am

Re: SendProcessMessage - who is responsible for disposing ar

Postby amaitland » Thu Oct 01, 2015 4:34 am

Better to ask this in the CefGlue forum?

Your stack trace isn't relevant in the context of plain CEF.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: SendProcessMessage - who is responsible for disposing ar

Postby Tsury » Thu Oct 01, 2015 5:29 am

I will. but I also wanted to know who is responsible for the destruction of the created message arguments...
Tsury
Mentor
 
Posts: 63
Joined: Mon Jan 19, 2015 4:31 am

Re: SendProcessMessage - who is responsible for disposing ar

Postby amaitland » Thu Oct 01, 2015 6:55 am

That depends on how they're wrapped in `CefGlue`. From a `CEF` point of view, they're ref counted, so soon as the last reference goes, the memory is released.

That is likely quite different with the way `CefGlue` wraps the classes. I doubt you'd be seeing the same problem using straight `C++`
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 69 guests

cron