From 2aa26699fe6e1d7ab0162df5e889f2096d190eb0 Mon Sep 17 00:00:00 2001 From: "Jerry.Kirk%Nexwarecorp.com" Date: Tue, 25 Jan 2000 03:00:41 +0000 Subject: [PATCH] Fix the destructor, it leaks less this way. r=kedl git-svn-id: svn://10.0.0.236/trunk@58530 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp b/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp index 4b02fe90a27..c4214fa0458 100644 --- a/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp +++ b/mozilla/gfx/src/photon/nsDrawingSurfacePh.cpp @@ -26,6 +26,7 @@ #include "nsPhGfxLog.h" #include #include +#include /* The Transparency Mask of the last image Draw'd in nsRenderingContextPh */ /* This is needed for locking and unlocking */ @@ -84,8 +85,8 @@ nsDrawingSurfacePh :: ~nsDrawingSurfacePh() if (mIsOffscreen) { - //PmMemReleaseMC( mMC); /* this function has an error! */ - free(mMC); + mMC->dc.gc = NULL; /* leave gc for now (leaks "less") */ + PmMemReleaseMC( mMC); /* this function releases the GC */ mMC = nsnull; PgShmemDestroy( mPixmap->image ); mPixmap->image = nsnull; @@ -349,6 +350,7 @@ NS_IMETHODIMP nsDrawingSurfacePh :: Init( PhGC_t * &aGC, PRUint32 aWidth, if (mPixmap->image == NULL) { + printf("nsDrawingSurfacePh::Init Out of Memory calling PgShmemCreate dim=<%d,%d> bytes_per_pixel=<%d> errno=<%d>\n", dim.w,dim.h,bytes_per_pixel, errno); NS_ASSERTION(0,"nsDrawingSurfacePh::Init Out of Memory calling PgShmemCreate"); abort(); return NS_ERROR_FAILURE; @@ -450,11 +452,6 @@ NS_IMETHODIMP nsDrawingSurfacePh :: Select( void ) PgSetGC(mGC); } - /* Clear out the Multi-clip, it will be reset if needed */ - /* This fixed the toolbar drawing */ - // PgSetMultiClip(0,NULL); /* Moved this to the Init section */ - - #ifdef DEBUG PhRect_t *rect; int rect_count; @@ -546,7 +543,8 @@ NS_IMETHODIMP nsDrawingSurfacePh::Flush(void) if (err == -1) { NS_ASSERTION(0,"nsDrawingSurfacePh::Flush Error with PgFlush of Offscreen DrawingSurface"); - abort(); + DebugBreak(); + //abort(); } } }