diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 00:19:41 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-01 00:19:41 +0000 |
commit | a81f30ac2508642cf92661c3beeb3cdc89f92c4a (patch) | |
tree | 5cb0ada12420fbdfd7e697b7f7f679f9b43937dc /webkit/glue | |
parent | 646b596a65d4e70ec63b80d0e0f6ef50a96a7b4b (diff) | |
download | chromium_src-a81f30ac2508642cf92661c3beeb3cdc89f92c4a.zip chromium_src-a81f30ac2508642cf92661c3beeb3cdc89f92c4a.tar.gz chromium_src-a81f30ac2508642cf92661c3beeb3cdc89f92c4a.tar.bz2 |
linux: fix some plugin colormap leaks
This code was wrong from the start; I know better now.
TEST=windowless plugins still draw (I tried in in test_shell)
BUG=19238
Review URL: http://codereview.chromium.org/180051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index ad93428b..0b5fd5f 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; |