1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 04:52:30 +01:00

Be slightly paranoid about memory leaks.

This commit is contained in:
Kris Maglione
2009-11-14 02:19:51 -05:00
parent e2a8cd4a68
commit dcedb36e9b

View File

@@ -499,7 +499,7 @@ const RangeFinder = Module("rangefinder", {
// It's possible, with :tabdetach, for the rangeFind to actually move
// 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 ||
matchCase ^ this.rangeFind.matchCase || backward ^ this.rangeFind.reverse) {
if (this.rangeFind)
@@ -647,7 +647,7 @@ const RangeFinder = Module("rangefinder", {
const RangeFind = Class("RangeFind", {
init: function (matchCase, backward, elementPath) {
this.window = window;
this.window = Cu.getWeakReference(window);
this.elementPath = elementPath || null;
this.matchCase = Boolean(matchCase);
this.reverse = Boolean(backward);