Skip to content
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

Prevent TypeError: page is undefined when the document has been destroyed (PR 6546 follow-up) #6560

Merged
merged 1 commit into from
Oct 23, 2015
Merged

Prevent TypeError: page is undefined when the document has been destroyed (PR 6546 follow-up) #6560

merged 1 commit into from
Oct 23, 2015

Conversation

Snuffleupagus
Copy link
Collaborator

Follow-up to PR #6546.

If rendering has already started when the document is destroyed, then this.pageCache[data.pageIndex] may already have been cleared when the StartRenderingPage/RenderPageChunk messages are recieved in api.js, which results in TypeErrors being thrown.

r? @yurydelendik

@yurydelendik
Copy link
Contributor

It's probably better to have approach, when we check for state rather than presence in the cache, e.g. via if (this.terminated) { /* ignore any pending requests if terminated */ return; }

…troyed (PR 6546 follow-up)

*Follow-up to PR 6546.*

If rendering has already started when the document is destroyed, then `this.pageCache[data.pageIndex]` may already have been cleared when the `StartRenderingPage`/`RenderPageChunk` messages are recieved in `api.js`, which results in `TypeError`s being thrown.
@Snuffleupagus
Copy link
Collaborator Author

It's probably better to have approach, when we check for state rather than presence in the cache

Sure; I've pushed an updated version of the patch.

@yurydelendik
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/069462ab9318211/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/069462ab9318211/output.txt

Total script time: 19.62 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

yurydelendik added a commit that referenced this pull request Oct 23, 2015
…r_page_is_undefined

Prevent `TypeError: page is undefined` when the document has been destroyed (PR 6546 follow-up)
@yurydelendik yurydelendik merged commit 4afd51a into mozilla:master Oct 23, 2015
@yurydelendik
Copy link
Contributor

Thank you for the patch.

@Snuffleupagus Snuffleupagus deleted the pr-6546-followup-TypeError_page_is_undefined branch October 23, 2015 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants