Skip to content
Snippets Groups Projects
Commit 8533b4b0 authored by jhawkins@chromium.org's avatar jhawkins@chromium.org
Browse files

gtk: Two fixes for the tab leak:

* The tab strip handles the lifetime of the tab widget, so don't try to increase the ref count in order to destroy the widget later.
* Use DeleteSoon when deleting the dragged tab in order to give gtk a chance to clean up its ref counts added during the drag operation.

BUG=12863
TEST=Extensive tab dragging.  No crashes and the Linux UI valgrind bot should stay green.
Review URL: http://codereview.chromium.org/159166

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21230 0039d316-1c4b-4281-b951-d872f2087c98
parent 4a78da0a
No related merge requests found
......@@ -113,7 +113,6 @@ TabGtk::TabGtk(TabDelegate* delegate)
closing_(false),
dragging_(false) {
event_box_ = gtk_event_box_new();
g_object_ref(event_box_);
gtk_event_box_set_visible_window(GTK_EVENT_BOX(event_box_), FALSE);
gtk_drag_source_set(event_box_, GDK_BUTTON1_MASK,
NULL, 0, GDK_ACTION_MOVE);
......@@ -150,8 +149,6 @@ TabGtk::~TabGtk() {
// Invoke this so that we hide the highlight.
ContextMenuClosed();
}
gtk_widget_destroy(event_box_);
}
// static
......
......@@ -829,7 +829,10 @@ void TabStripGtk::DestroyDraggedSourceTab(TabGtk* tab) {
}
gtk_container_remove(GTK_CONTAINER(tabstrip_.get()), tab->widget());
delete tab;
// If we delete the dragged source tab here, the gtk drag-n-drop API won't
// get a change to clean up and remove any references it's added to the tab
// widget, so we'll leak the widget.
MessageLoop::current()->DeleteSoon(FROM_HERE, tab);
// Force a layout here, because if we've just quickly drag detached a Tab,
// the stopping of the active animation above may have left the TabStrip in a
......
......@@ -621,18 +621,6 @@
fun:_ZN7WebCore11ImageSource18createFrameAtIndexEj
fun:_ZNK11webkit_glue12ImageDecoder6DecodeEPKhj
}
{
# very common in ui tests
bug_12863
Memcheck:Leak
fun:malloc
fun:g_malloc
...
fun:gtk_event_box_new
fun:_ZN6TabGtkC1EPNS_11TabDelegateE
fun:_ZN11TabStripGtk13TabInsertedAtEP11TabContentsib
fun:_ZN13TabStripModel19InsertTabContentsAtEiP11TabContentsbb
}
{
bug_15762
Memcheck:Cond
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment