mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 09:55:47 +01:00
Be slightly paranoid about memory leaks.
This commit is contained in:
@@ -499,7 +499,7 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
|
|
||||||
// It's possible, with :tabdetach, for the rangeFind to actually move
|
// It's possible, with :tabdetach, for the rangeFind to actually move
|
||||||
// from one window to another, which breaks things.
|
// from one window to another, which breaks things.
|
||||||
if (!this.rangeFind || this.rangeFind.window != window ||
|
if (!this.rangeFind || this.rangeFind.window.get() != window ||
|
||||||
linksOnly ^ !!this.rangeFind.elementPath ||
|
linksOnly ^ !!this.rangeFind.elementPath ||
|
||||||
matchCase ^ this.rangeFind.matchCase || backward ^ this.rangeFind.reverse) {
|
matchCase ^ this.rangeFind.matchCase || backward ^ this.rangeFind.reverse) {
|
||||||
if (this.rangeFind)
|
if (this.rangeFind)
|
||||||
@@ -647,7 +647,7 @@ const RangeFinder = Module("rangefinder", {
|
|||||||
|
|
||||||
const RangeFind = Class("RangeFind", {
|
const RangeFind = Class("RangeFind", {
|
||||||
init: function (matchCase, backward, elementPath) {
|
init: function (matchCase, backward, elementPath) {
|
||||||
this.window = window;
|
this.window = Cu.getWeakReference(window);
|
||||||
this.elementPath = elementPath || null;
|
this.elementPath = elementPath || null;
|
||||||
this.matchCase = Boolean(matchCase);
|
this.matchCase = Boolean(matchCase);
|
||||||
this.reverse = Boolean(backward);
|
this.reverse = Boolean(backward);
|
||||||
|
|||||||
Reference in New Issue
Block a user