If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

VERIFIED FIXED in M15

Status

Core Graveyard
GFX
P3
normal
VERIFIED FIXED
18 years ago
9 years ago

People

(Reporter: Patrick C. Beard, Assigned: dcone (gone))

Tracking

({mlk})

Trunk
PowerPC
All

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
On line 323, a call to nsRenderingContextMac::GetDeviceContext() isn't being 
balanced with an NS_RELEASE. This causes an nsDeviceContextMac leak.
(Reporter)

Updated

18 years ago
OS: Mac System 8.5 → All
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

18 years ago
Target Milestone: M15

Comment 1

18 years ago
dcone--can we get a fix for this bug soon?  Thanks!
(Assignee)

Comment 2

18 years ago
As soon as the tree opens...
Keywords: mlk
(Reporter)

Comment 3

18 years ago
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);
(Assignee)

Comment 4

18 years ago
code changed
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 5

18 years ago
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.