Closed
Bug 7062
Opened 25 years ago
Closed 25 years ago
nsTitledButtonFrame::DisplayAltFeedback is passing a null pointer to aRenderingContext.DrawImage on startup up apprunner
Categories
(Core :: Graphics: ImageLib, defect, P3)
Tracking
()
VERIFIED
FIXED
M15
People
(Reporter: kmcclusk, Assigned: kmcclusk)
Details
This bug first presented itself as bug #6934 where apprunner was crashing on
startup approx 20% of the time. When it crashed
nsTitledButtonFrame::DisplayAltFeedback is passing a null pointer to
aRenderingContext.DrawImage. I put a check for a null image pointer after the
call to LoadIconImage. The question remains as to why LoadIconImage sometimes
comes back with a null pointer.
Note: this problem should also exist in nsImageFrame::DisplayAltFeedback since
it has the same implementation with nsTitledButtonFrame::DisplayAltFeedback.
void
nsTitledButtonFrame::DisplayAltFeedback(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
PRInt32 aIconId)
...
#ifdef _WIN32
// Display the icon
nsIDeviceContext* dc;
aRenderingContext.GetDeviceContext(dc);
nsIImage* icon;
if (NS_SUCCEEDED(dc->LoadIconImage(aIconId, icon))) {
if (nsnull != icon) { // New check to stop bug #6934 Frequent (~20%) crash
crashes in raptorgfxwin.dll on apprunner startup
aRenderingContext.DrawImage(icon, inner.x, inner.y);
// Reduce the inner rect by the width of the icon, and leave an
// additional six pixels padding
PRInt32 iconWidth = NSIntPixelsToTwips(icon->GetWidth() + 6, p2t);
inner.x += iconWidth;
inner.width -= iconWidth;
NS_RELEASE(icon);
}
}
NS_RELEASE(dc);
#endif
...
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M8
Assignee | ||
Updated•25 years ago
|
Target Milestone: M8 → M9
Assignee | ||
Updated•25 years ago
|
Target Milestone: M9 → M10
Assignee | ||
Updated•25 years ago
|
Target Milestone: M10 → M11
Assignee | ||
Comment 1•25 years ago
|
||
Moving to M11
Assignee | ||
Updated•25 years ago
|
Target Milestone: M11 → M15
Assignee | ||
Comment 2•25 years ago
|
||
The nsTitledButton should contain the nsnull check that was put in earlier.
There is still a mystery of why the LoadIconImage fails to load the image.
Looking at it in the debugger, the GetImage call is return nsnull, possibly
because the ic's status is set to BAD. Needs more investigation.
Moving non-beta blockers to M15.
Assignee | ||
Comment 3•25 years ago
|
||
The LoadIconImage no longer fails. I set a conditional break point in the
debugger and the icon returned from LoadIconImage is never null.
Marking as fixed.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 4•25 years ago
|
||
Hey, Kevin ---
Shall I rubber-stamp this as verified, or would you like to designate a peer to
verify your code change? Thanks!
Assignee | ||
Comment 5•25 years ago
|
||
Yes, go ahead an rubberstamp it. No code was changed, When running mozilla in a
debugger I am able to verify that it no longer returns with nsnull.
You need to log in
before you can comment on or make changes to this bug.
Description
•