Ensure textSource is cleaned up if it isn't used

This commit is contained in:
toasted-nutbread 2020-01-25 11:17:39 -05:00
parent e70638e8ea
commit 54a48a7a9b

View File

@ -299,11 +299,11 @@ class TextScanner {
}
const textSource = docRangeFromPoint(x, y, this.options.scanning.deepDomScan);
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
return;
}
try {
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
return;
}
this.pendingLookup = true;
const result = await this.onSearchSource(textSource, cause);
if (result !== null) {