Closed Bug 28559 Opened 26 years ago Closed 26 years ago

[MLK] Leaking nsDeviceContextMac in nsImageMac::Draw()

Categories

(Core Graveyard :: GFX, defect, P3)

PowerPC
All
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: beard, Assigned: dcone)

References

()

Details

(Keywords: memory-leak)

On line 323, a call to nsRenderingContextMac::GetDeviceContext() isn't being balanced with an NS_RELEASE. This causes an nsDeviceContextMac leak.
OS: Mac System 8.5 → All
Status: NEW → ASSIGNED
Target Milestone: M15
dcone--can we get a fix for this bug soon? Thanks!
As soon as the tree opens...
Here's a patch against latest source: Index: mozilla/gfx/src/mac/nsImageMac.cpp =================================================================== RCS file: /cvsroot/mozilla/gfx/src/mac/nsImageMac.cpp,v retrieving revision 1.24 diff -c -2 -r1.24 nsImageMac.cpp *** nsImageMac.cpp 2000/03/11 03:07:26 1.24 --- nsImageMac.cpp 2000/03/12 16:41:11 *************** *** 291,296 **** { PixMapHandle imagePixMap; ! Rect srcRect, dstRect, maskRect; ! nsDeviceContextMac *theDevContext; if (!mImageGWorld) --- 291,295 ---- { PixMapHandle imagePixMap; ! Rect srcRect, dstRect, maskRect; if (!mImageGWorld) *************** *** 336,342 **** #if !TARGET_CARBON // can only do this if we are NOT printing ! aContext.GetDeviceContext(theDevContext); ! ! if(!theDevContext->IsPrinter()){ #endif ::CopyDeepMask((BitMap*)*imagePixMap, (BitMap*)*maskPixMap, (BitMap*)*destPixels, &srcRect, &maskRect, &dstRect, srcCopy, nsnull); --- 335,343 ---- #if !TARGET_CARBON // can only do this if we are NOT printing ! nsCOMPtr<nsIDeviceContext> deviceContext; ! aContext.GetDeviceContext(*getter_AddRefs(deviceContext)); ! nsDeviceContextMac* macDeviceContext = dynamic_cast<nsDeviceContextMac* >((nsIDeviceContext*) deviceContext); ! ! if(macDeviceContext && !macDeviceContext->IsPrinter()){ #endif ::CopyDeepMask((BitMap*)*imagePixMap, (BitMap*)*maskPixMap, (BitMap*)*destPixels, &srcRect, &maskRect, &dstRect, srcCopy, nsnull);
code changed
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Marking verified in the May 22 nd build.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.