Closed Bug 345371 Opened 16 years ago Closed 16 years ago
Check before using weak pointer in ns
Caret (Crash [@ ns Caret::Draw Caret])
Talkback ID TB21175066W. Not reproducable, but it's easy to guess what's causing the crash, and it really should get fixed in any case. Using a weak pointer without checking it's valid is a bad idea. http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCaret.cpp&rev=1.160&mark=985-986#984 It's apparently rare; Talkback says there have been 62 crashes in nsCaret::DrawCaret since late March. Easy patch coming up to fix all the unchecked uses of mPresShell. Setting dependency on bug 305798 since that patch added the relevant code.
Assignee: nobody → sharparrow1
Status: NEW → ASSIGNED
Attachment #230004 - Flags: review?(roc)
In my defense, there was already one use of the unchecked weak pointer (in GetCaretCoordinates) prior to my fix for bug 305798. I probably just copied that to the other places. Anyway, thanks for finding this and providing a patch.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment on attachment 230004 [details] [diff] [review] Patch Probably a good idea to get this on the branch.
Attachment #230004 - Flags: approval1.8.1?
Comment on attachment 230004 [details] [diff] [review] Patch a=darin on behalf of drivers
Attachment #230004 - Flags: approval1.8.1? → approval1.8.1+
The trunk patch doesn't apply cleanly to the 1.8.1 branch. Someone should check if this patch is correct for the 1.8.1 branch, I think it is.
Missed http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/base/nsCaret.cpp&rev=MOZILLA_1_8_BRANCH&cvsroot=/cvsroot&mark=552-555#550 Looks good otherwise; thanks.
Ok, thanks, then I guess this is good to go in.
Attachment #230358 - Attachment is obsolete: true
Checking in nsCaret.cpp; /cvsroot/mozilla/layout/base/nsCaret.cpp,v <-- nsCaret.cpp new revision: 18.104.22.168; previous revision: 22.214.171.124 done Checked into 1.8.1 branch.
Whiteboard: [checkin needed (1.8 branch)]
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.