fix a gc leak

This commit is contained in:
pavlov%netscape.com 2000-04-01 20:11:28 +00:00
parent 4e5f616edc
commit b03e94d1a3

View File

@ -52,8 +52,8 @@ nsToolkit::~nsToolkit()
gdk_gc_destroy(mSharedGC);
}
// Remove the TLS reference to the toolkit...
PR_SetThreadPrivate(gToolkitTLSIndex, nsnull);
// Remove the TLS reference to the toolkit...
PR_SetThreadPrivate(gToolkitTLSIndex, nsnull);
}
//-------------------------------------------------------------------------
@ -71,10 +71,9 @@ void nsToolkit::CreateSharedGC(void)
if (mSharedGC)
return;
pixmap = ::gdk_pixmap_new (NULL, 1, 1, gdk_rgb_get_visual()->depth);
mSharedGC = ::gdk_gc_new (pixmap);
gdk_pixmap_unref (pixmap);
mSharedGC = gdk_gc_ref(mSharedGC);
pixmap = gdk_pixmap_new(NULL, 1, 1, gdk_rgb_get_visual()->depth);
mSharedGC = gdk_gc_new(pixmap);
gdk_pixmap_unref(pixmap);
}
GdkGC *nsToolkit::GetSharedGC(void)