-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[AnnotationEditorLayerBuilder] Inline the destroy
code in the cancel
method
#15800
[AnnotationEditorLayerBuilder] Inline the destroy
code in the cancel
method
#15800
Conversation
…el` method It doesn't seem necessary to have a *separate* `destroy` method given that the `cancel` method always invokes it unconditionally. In the `PDFPageView.reset` method we currently attempt to call `destroy` directly, however that'll never actually happen since either: - We're keeping the annotationEditorLayer, in which case we're just hiding the layer and nothing more (and the relevant branch is never entered). - We're removing the annotationEditorLayer, in which case the `PDFPageView.cancelRendering` method has already cancelled *and* nulled it (and there's thus nothing left to `destroy` here). *Please note:* Hopefully I'm not overlooking something obvious here, since both reading through the code *and* also adding `console.log(this.annotationEditorLayer);` [before this line](https://github.com/mozilla/pdf.js/blob/9d4aadbf7a32c8a994818e848fb2ec883f257702/web/pdf_page_view.js#L438) suggests that it's indeed unnecessary.
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/8591ce8c8b006a8/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/8591ce8c8b006a8/output.txt Total script time: 1.26 mins Published |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/928ce68b6cdb992/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/dd893e11e025df9/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/928ce68b6cdb992/output.txt Total script time: 4.21 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/dd893e11e025df9/output.txt Total script time: 25.37 mins
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It doesn't seem necessary to have a separate
destroy
method given that thecancel
method always invokes it unconditionally. In thePDFPageView.reset
method we currently attempt to calldestroy
directly, however that'll never actually happen since either:PDFPageView.cancelRendering
method has already cancelled and nulled it (and there's thus nothing left todestroy
here).Please note: Hopefully I'm not overlooking something obvious here, since both reading through the code and also adding
console.log(this.annotationEditorLayer);
before this line suggests that it's indeed unnecessary.