Rooting hazard in Navigator::HasTelephonySupport

RESOLVED DUPLICATE of bug 940765

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 940765
4 years ago
4 years ago

People

(Reporter: bz, Unassigned)

Tracking

({regression})

Firefox Tracking Flags

(Not tracked)

Details

Bug 915604 introduced a rooting hazard: the unrooted aGlobal is used after the preference get, and we have no guarantee that the preference get won't GC.

I recommend moving this line:

  nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);

to before the preference get.
Hm, I did it the other way, by rooting the global. I was afraid GetWindowFromGlobal might be expensive.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 940765
You need to log in before you can comment on or make changes to this bug.