New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: crash on window.print() #19601
fix: crash on window.print() #19601
Conversation
Release Notes Persisted
|
I was unable to backport this PR to "6-0-x" cleanly; |
I was unable to backport this PR to "5-0-x" cleanly; |
I have automatically backported this PR to "7-0-x", please check out #19623 |
A maintainer has manually backported this PR to "6-0-x", please check out #19677 |
A maintainer has manually backported this PR to "5-0-x", please check out #19678 |
i have the same problem in electron v9, will it be solved soon? |
@rgarcia1990 this should be fixed in v9. If you are still having issues, please fill out a new issue with a proper repro and other aspects of the template filled. |
it seems that the problem is when you try to print a page from version 9 using pdf viewer... it easy to reproduce just load a browserwindow from an url with pdf and try to print. |
i created the issue for that problem. It is very important for me if you can help me! Thanks for considering my request! |
Description of Change
Fixes #19539.
window.print()
doesn't invokePrintViewManagerBase::PrintNowInternal
, so when we movedinto that function from
PrintViewManagerBase::CreateNewPrintJob()
we inadvertently created a side-effect wherein inPrintViewManagerBase::ReleasePrintJob()
it would try to unregister a notification listener which wasn't registered, and would therefore CHECK onfound != registered_.end()
.This fixes that by guarding the unregistration with a null check on
callback_
, which would only be non-null when in the call chain of ourwebContents.print()
implementation, sincecallback_
is a member we patched in ourselves as part of that method.cc @jkleinsc @PalmerAL @deepak1556
Checklist
npm test
passesRelease Notes
Notes: Fixed a crash in
window.print()
.