summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 20:43:15 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 20:43:15 +0000
commit3e34f9b81967742052e2a4f38cd22d3bc0713b95 (patch)
tree1cdd2d69cb57287cc8aedd1591526477d6113092 /chrome/browser/gtk
parent1a2d0bb461937e0101cfb48216f8420a642327b2 (diff)
downloadchromium_src-3e34f9b81967742052e2a4f38cd22d3bc0713b95.zip
chromium_src-3e34f9b81967742052e2a4f38cd22d3bc0713b95.tar.gz
chromium_src-3e34f9b81967742052e2a4f38cd22d3bc0713b95.tar.bz2
GTK: Another attempt at fixing gtk_floating_container_forall() crasher.
Tie the lifetime of the GtkFloatingContainer to TabContentsContainerGtk. Working theory is that we're leaking that reference, which is causing the crash. http://crbug.com/14485 Review URL: http://codereview.chromium.org/147163 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/tab_contents_container_gtk.cc19
-rw-r--r--chrome/browser/gtk/tab_contents_container_gtk.h3
2 files changed, 12 insertions, 10 deletions
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.cc b/chrome/browser/gtk/tab_contents_container_gtk.cc
index 41d2d9a..d55f9ca 100644
--- a/chrome/browser/gtk/tab_contents_container_gtk.cc
+++ b/chrome/browser/gtk/tab_contents_container_gtk.cc
@@ -34,6 +34,7 @@ TabContentsContainerGtk::TabContentsContainerGtk(StatusBubbleGtk* status_bubble)
}
TabContentsContainerGtk::~TabContentsContainerGtk() {
+ floating_.Destroy();
}
void TabContentsContainerGtk::Init() {
@@ -45,29 +46,29 @@ void TabContentsContainerGtk::Init() {
// || ||
// || ||
// || ||
- // |+- (StatusBubble) ------+ +- (Popups) ------------+|
- // |+ +----------------+ ||
- // |+-----------------------+ +-----------------------+|
+ // |+- (StatusBubble) ------+ ||
+ // |+ + ||
+ // |+-----------------------+----------------------------------------+|
// +------------------------------------------------------------------+
- floating_ = gtk_floating_container_new();
+ floating_.Own(gtk_floating_container_new());
fixed_ = gtk_fixed_new();
g_signal_connect(fixed_, "size-allocate",
G_CALLBACK(OnFixedSizeAllocate), this);
- gtk_container_add(GTK_CONTAINER(floating_), fixed_);
+ gtk_container_add(GTK_CONTAINER(floating_.get()), fixed_);
- gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_),
+ gtk_floating_container_add_floating(GTK_FLOATING_CONTAINER(floating_.get()),
status_bubble_->widget());
- g_signal_connect(floating_, "set-floating-position",
+ g_signal_connect(floating_.get(), "set-floating-position",
G_CALLBACK(OnSetFloatingPosition), this);
gtk_widget_show(fixed_);
- gtk_widget_show(floating_);
+ gtk_widget_show(floating_.get());
}
void TabContentsContainerGtk::AddContainerToBox(GtkWidget* box) {
- gtk_box_pack_start(GTK_BOX(box), floating_, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(box), floating_.get(), TRUE, TRUE, 0);
}
void TabContentsContainerGtk::SetTabContents(TabContents* tab_contents) {
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.h b/chrome/browser/gtk/tab_contents_container_gtk.h
index d6df96c..ec524a5 100644
--- a/chrome/browser/gtk/tab_contents_container_gtk.h
+++ b/chrome/browser/gtk/tab_contents_container_gtk.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "chrome/common/notification_registrar.h"
+#include "chrome/common/owned_widget_gtk.h"
class RenderViewHost;
class StatusBubbleGtk;
@@ -80,7 +81,7 @@ class TabContentsContainerGtk : public NotificationObserver {
// GtkBin and a GtkFixed, |floating_| has |fixed_| as its one "real" child,
// and the various things that hang off the bottom (status bubble, etc) have
// their positions manually set in OnSetFloatingPosition.
- GtkWidget* floating_;
+ OwnedWidgetGtk floating_;
// We insert and remove TabContents GtkWidgets into this fixed_. This should
// not be a GtkVBox since there were errors with timing where the vbox was