Remove duplicate drawingsurface. fix memory leak

This commit is contained in:
spider 1998-06-11 01:22:26 +00:00
Родитель b692541c9e
Коммит 2fad7b8ec3
2 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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();