Ensure textSource is cleaned up if it isn't used
This commit is contained in:
parent
e70638e8ea
commit
54a48a7a9b
@ -299,11 +299,11 @@ class TextScanner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const textSource = docRangeFromPoint(x, y, this.options.scanning.deepDomScan);
|
const textSource = docRangeFromPoint(x, y, this.options.scanning.deepDomScan);
|
||||||
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (this.textSourceCurrent !== null && this.textSourceCurrent.equals(textSource)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.pendingLookup = true;
|
this.pendingLookup = true;
|
||||||
const result = await this.onSearchSource(textSource, cause);
|
const result = await this.onSearchSource(textSource, cause);
|
||||||
if (result !== null) {
|
if (result !== null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user