mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Remove duplicate drawingsurface. fix memory leak
This commit is contained in:
parent
b692541c9e
commit
2fad7b8ec3
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user