Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,12 @@ void GeckoVBufBackend_t::renderThread_initialize() {
void GeckoVBufBackend_t::renderThread_terminate() {
unregisterWinEventHook(renderThread_winEventProcHook);
VBufBackend_t::renderThread_terminate();
// The backend holds a reference to the root accessible of the document.
// This must be specifically released here, in the UI thread where it was created.
// See https://issues.chromium.org/issues/41487612
if(this->rootDocAcc) {
Comment thread
seanbudd marked this conversation as resolved.
Resolved
this->rootDocAcc.Release();
}
}

void GeckoVBufBackend_t::render(VBufStorage_buffer_t* buffer, int docHandle, int ID, VBufStorage_controlFieldNode_t* oldNode) {
Expand All @@ -1502,6 +1508,18 @@ GeckoVBufBackend_t::GeckoVBufBackend_t(int docHandle, int ID): VBufBackend_t(doc
}

GeckoVBufBackend_t::~GeckoVBufBackend_t() {
// The backend holds a reference to the root accessible of the document.
// This must be specifically released in the UI thread where it was created.
// See https://issues.chromium.org/issues/41487612
// In most cases this will be released in renderThread_terminate.
// However in the unlikely case terminate can't run,
// We must detach and leak the COM pointer here,
Comment thread
seanbudd marked this conversation as resolved.
Resolved
// Otherwise it would be automatically deleted along with the backend which would cause a crash,
Comment thread
seanbudd marked this conversation as resolved.
Resolved
// as the COM object would be released from within an RPC worker thread.
nhAssert(!rootDocAcc);
if(this->rootDocAcc) {
Comment thread
seanbudd marked this conversation as resolved.
Resolved
this->rootDocAcc.Detach();
}
}

VBufBackend_t* GeckoVBufBackend_t_createInstance(int docHandle, int ID) {
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ A warning message will inform you if you try writing to a non-empty directory. (
* Playing NVDA sounds no longer fails on a mono audio device. (#16770, @jcsteh)
* NVDA will report addresses when arrowing through To/CC/BCC fields in outlook.com / Modern Outlook. (#16856)
* NVDA now handles add-on installation failures more gracefully. (#16704)
* No longer cause Google Chrome to crash when closing a document or exiting Chrome. (#16893)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this to the "web browser fixes" sub-list at the start of bug fixes


### Changes for Developers

Expand Down