chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.09k stars 450 forks source link

Crash when closing browser with cefAudioHandler #3707

Closed vtruant closed 1 month ago

vtruant commented 1 month ago

Describe the bug

As I need to have access to audio samples I override GetAudioHandler() to return my custom object.

When I call close browser after visiting a page with audio content my application crashes with this stack:

AudioInputDevice (68)#0 0x0000000120117188 in base::ImmediateCrash() [inlined] at immediate_crash.h:176 logging::CheckFailure() [inlined] at check.h:212 mojo::InterfaceEndpointClient::~InterfaceEndpointClient() at interface_endpoint_client.cc:498 mojo::InterfaceEndpointClient::~InterfaceEndpointClient() [inlined] at interface_endpoint_client.cc:497 mojo::InterfaceEndpointClient::~InterfaceEndpointClient() at interface_endpoint_client.cc:497 std::Cr::default_delete::operator()(mojo::InterfaceEndpointClient*) const [inlined] at /Volumes/Developer/CEF/AutomatedBuild/download/chromium/src/third_party/libc++/src/include/memory/unique_ptr.h:68 std::Cr::unique_ptr<mojo::InterfaceEndpointClient, std::Cr::default_delete>::reset(mojo::InterfaceEndpointClient*) [inlined] at /Volumes/Developer/CEF/AutomatedBuild/download/chromium/src/third_party/libc++/src/include/memory/unique_ptr.h:279 mojo::internal::InterfacePtrStateBase::~InterfacePtrStateBase() at interface_ptr_state.cc:21 mojo::internal::InterfacePtrState::~InterfacePtrState() [inlined] at interface_ptr_state.h:141 mojo::internal::InterfacePtrState::~InterfacePtrState() [inlined] at interface_ptr_state.h:141 mojo::Remote::reset() [inlined] at /remote.h:217 mirroring::CapturedAudioInput::CloseStream() at captured_audio_input.cc:53 media::AudioInputDevice::Stop() at audio_input_device.cc:168 CefAudioCapturer::StopStream() [inlined] at audio_capturer.cc:125 CefAudioCapturer::OnCaptureError(media::AudioCapturerSource::ErrorCode, std::__Cr::basic_string<char, std::Cr::char_traits, std::__Cr::allocator> const&) at /Volumes/Developer/CEF/AutomatedBuild/download/chromium/src/cef/libcef/browser/audio_capturer.cc:120 media::AudioInputDevice::AudioThreadCallback::OnSocketError() at audio_input_device.cc:501 media::AudioDeviceThread::ThreadMain() at audio_device_thread.cc:118 base::(anonymous namespace)::ThreadFunc(void*) at platform_thread_posix.cc:103 _pthread_start ()

Is there something I need to call before calling: _browser->GetHost()->CloseBrowser(/ force_close /true);

To Reproduce Steps to reproduce the behavior: 1, Create a custom CefClient that return a custom CefAudioHandler

  1. Go to 'youtube.com'
  2. Click on 'play' to start the video
  3. CloseBrowser

Versions:

magreenblatt commented 1 month ago

Duplicate of #3689.