Remove duplicate drawingsurface. fix memory leak

This commit is contained in:
spider 1998-06-11 01:22:26 +00:00
parent b692541c9e
commit 2fad7b8ec3
2 changed files with 2 additions and 6 deletions

View File

@ -140,12 +140,6 @@ nsIRenderingContext * nsDeviceContextUnix :: CreateRenderingContext(nsIView *aVi
nsIWidget *win = aView->GetWidget();
nsresult rv;
mSurface = new nsDrawingSurfaceUnix();
mSurface->display = (Display *)win->GetNativeData(NS_NATIVE_DISPLAY);
mSurface->drawable = (Drawable)win->GetNativeData(NS_NATIVE_WINDOW);
mSurface->gc = (GC)win->GetNativeData(NS_NATIVE_GRAPHIC);
static NS_DEFINE_IID(kRCCID, NS_RENDERING_CONTEXT_CID);
static NS_DEFINE_IID(kRCIID, NS_IRENDERING_CONTEXT_IID);

View File

@ -119,6 +119,7 @@ nsRenderingContextUnix :: ~nsRenderingContextUnix()
mStateCache = nsnull;
}
delete mRenderingSurface;
}
NS_IMPL_QUERY_INTERFACE(nsRenderingContextUnix, kRenderingContextIID)
@ -138,6 +139,7 @@ nsresult nsRenderingContextUnix :: Init(nsIDeviceContext* aContext,
mRenderingSurface->drawable = (Drawable)aWindow->GetNativeData(NS_NATIVE_WINDOW);
mRenderingSurface->gc = (GC)aWindow->GetNativeData(NS_NATIVE_GRAPHIC);
((nsDeviceContextUnix *)aContext)->SetDrawingSurface(mRenderingSurface);
((nsDeviceContextUnix *)aContext)->InstallColormap();