Closed Bug 1029486 Opened 7 years ago Closed 7 years ago

"TypeError: can't access dead object" at TranslationContentHandler.jsm:91

Categories

(Firefox :: Translation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 33
Tracking Status
firefox32 --- fixed
firefox33 --- fixed

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file)

Closing the tab quickly after it has loaded might result in an error with language detection enabled.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Attachment #8445119 - Flags: review?(felipc)
Comment on attachment 8445119 [details] [diff] [review]
0001-Bug-1029486-Check-for-dead-wrappers-after-running-la.patch

Review of attachment 8445119 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/translation/TranslationContentHandler.jsm
@@ +90,5 @@
>          return;
> +      }
> +
> +      // The window might be gone by now.
> +      if (Cu.isDeadWrapper(content)) {

does just checking `if (content)` work too?
Attachment #8445119 - Flags: review?(felipc) → review+
I don't think it does, probably because the wrapper still exists as long as we reference it. Trying to access properties or doing anything with it throws the error. Cu.isDeadWrapper() seems fine and expressive to me though.
https://hg.mozilla.org/mozilla-central/rev/7fbdc618eb51
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 33
Comment on attachment 8445119 [details] [diff] [review]
0001-Bug-1029486-Check-for-dead-wrappers-after-running-la.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): This bug is part of the automatic translation feature, which we want to A/B with a subset of Aurora 32 users.
User impact if declined: An error message might appear in the error console if users open/close a tab quickly while language detection is running
Testing completed (on m-c, etc.): landed on m-c
Risk to taking this patch (and alternatives if risky): minimal
String or IDL/UUID changes made by this patch: none
Attachment #8445119 - Flags: approval-mozilla-aurora?
Attachment #8445119 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.