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)

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

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 ...
Status: NEW → ASSIGNED
Target Milestone: M8
Target Milestone: M8 → M9
Target Milestone: M9 → M10
Target Milestone: M10 → M11
Moving to M11
Target Milestone: M11 → M15
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.
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
Hey, Kevin --- Shall I rubber-stamp this as verified, or would you like to designate a peer to verify your code change? Thanks!
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.
Thank you, sir. Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.