mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
fix a memory leak.
This commit is contained in:
parent
1d2ade1398
commit
eb63856c74
@ -58,10 +58,9 @@ nsDrawingSurfaceGTK :: nsDrawingSurfaceGTK()
|
||||
|
||||
nsDrawingSurfaceGTK :: ~nsDrawingSurfaceGTK()
|
||||
{
|
||||
#ifdef NS_GTK_REF
|
||||
if (mPixmap)
|
||||
::gdk_pixmap_unref(mPixmap);
|
||||
#endif
|
||||
|
||||
if (mImage)
|
||||
::gdk_image_destroy(mImage);
|
||||
}
|
||||
@ -219,7 +218,6 @@ NS_IMETHODIMP nsDrawingSurfaceGTK :: Init(GdkGC *aGC, PRUint32 aWidth,
|
||||
mIsOffscreen = PR_TRUE;
|
||||
|
||||
mPixmap = ::gdk_pixmap_new(nsnull, mWidth, mHeight, mDepth);
|
||||
g_print("pixmap is not going to be freed\n");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -138,7 +138,11 @@ NS_IMETHODIMP nsRenderingContextGTK::Init(nsIDeviceContext* aContext,
|
||||
|
||||
if (mSurface)
|
||||
{
|
||||
#ifndef NS_GTK_REF
|
||||
GdkDrawable *win = (GdkDrawable*)gdk_window_ref((GdkWindow *)aWindow->GetNativeData(NS_NATIVE_WINDOW));
|
||||
#else
|
||||
GdkDrawable *win = (GdkDrawable *)aWindow->GetNativeData(NS_NATIVE_WINDOW);
|
||||
#endif
|
||||
GdkGC *gc = (GdkGC *)aWindow->GetNativeData(NS_NATIVE_GRAPHIC);
|
||||
mSurface->Init(win,gc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user