aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-25 11:17:39 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-26 10:31:17 -0500
commit54a48a7a9ba33fa07b3acaa775f3d1c384172dbd (patch)
tree07dea1d0dc0158b2c6447ab454dfa5b5c40aacd7 /ext/mixed
parente70638e8ea7f4d5e52b297d0b8482868933f8438 (diff)
Ensure textSource is cleaned up if it isn't used
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/text-scanner.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index e037109d..88f1e27a 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -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) {