Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: webkit/glue/plugins/webplugin_delegate_impl_gtk.cc

Issue 180051: linux: fix some plugin colormap leaks (Closed)
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
index ad93428bed378f500892b51c910659052820cbe0..0b5fd5fc49291a12debff11e715478d76d83703b 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
@@ -80,7 +80,6 @@ WebPluginDelegateImpl::~WebPluginDelegateImpl() {
}
if (pixmap_) {
- g_object_unref(gdk_drawable_get_colormap(pixmap_));
g_object_unref(pixmap_);
pixmap_ = NULL;
}
@@ -250,7 +249,6 @@ void WebPluginDelegateImpl::EnsurePixmapAtLeastSize(int width, int height) {
return; // We are already the appropriate size.
// Otherwise, we need to recreate ourselves.
- g_object_unref(gdk_drawable_get_colormap(pixmap_));
g_object_unref(pixmap_);
pixmap_ = NULL;
}
@@ -263,6 +261,8 @@ void WebPluginDelegateImpl::EnsurePixmapAtLeastSize(int width, int height) {
GdkColormap* colormap = gdk_colormap_new(gdk_visual_get_system(),
FALSE);
gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap_), colormap);
+ // The GdkDrawable now owns the GdkColormap.
+ g_object_unref(colormap);
}
#ifdef DEBUG_RECTANGLES
@@ -479,11 +479,9 @@ void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) {
NPSetWindowCallbackStruct* extra =
static_cast<NPSetWindowCallbackStruct*>(window_.ws_info);
extra->display = GDK_DISPLAY();
- GdkVisual* visual = gdk_visual_get_system();
- extra->visual = GDK_VISUAL_XVISUAL(visual);
- extra->depth = visual->depth;
- GdkColormap* colormap = gdk_colormap_new(gdk_visual_get_system(), FALSE);
- extra->colormap = GDK_COLORMAP_XCOLORMAP(colormap);
+ extra->visual = DefaultVisual(GDK_DISPLAY(), 0);
+ extra->depth = DefaultDepth(GDK_DISPLAY(), 0);
+ extra->colormap = DefaultColormap(GDK_DISPLAY(), 0);
if (!force_set_window)
windowless_needs_set_window_ = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698