Properly cancel streams and guard at getTextContent.

This commit is contained in:
Yury Delendik 2017-08-03 16:36:46 -05:00
parent 0c95bc7d83
commit a1dfbec532
3 changed files with 28 additions and 7 deletions

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createPromiseCapability, Util } from '../shared/util';
import { AbortException, createPromiseCapability, Util } from '../shared/util';
import { CustomStyle, getDefaultSetting } from './dom_utils';
/**
@ -498,7 +498,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
cancel: function TextLayer_cancel() {
if (this._reader) {
this._reader.cancel();
this._reader.cancel(new AbortException('text layer task cancelled'));
this._reader = null;
}
this._canceled = true;