Chromium Code Reviews| Index: chrome/browser/ui/gtk/tab_contents_container_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc |
| index 48e45a947656605852976a6f25319d0070474349..16aad3a0eae44532d254f9963f8819964c8ea853 100644 |
| --- a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc |
| +++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc |
| @@ -165,8 +165,9 @@ void TabContentsContainerGtk::DetachTab(TabContentsWrapper* tab) { |
| // It is possible to detach an unrealized, unparented TabContents if you |
| // slow things down enough in valgrind. Might happen in the real world, too. |
| - if (widget && widget->parent) { |
| - DCHECK_EQ(widget->parent, expanded_); |
| + GtkWidget* parent = gtk_widget_get_parent(widget); |
|
Evan Martin
2012/01/05 22:50:37
Do we need to null-check widget first here? We do
Elliot Glaysher
2012/01/05 23:19:49
Good catch
|
| + if (widget && parent) { |
| + DCHECK_EQ(parent, expanded_); |
| gtk_container_remove(GTK_CONTAINER(expanded_), widget); |
| } |
| } |