summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:55:48 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:55:48 +0000
commitd72aa00d29a465e37454afc6db6d1080c62051e3 (patch)
tree3b268802c4bf75328244a765bf09697ad4d4782c /chrome
parenta7cc2738d2e280f479796be3a4b1ae87343eb938 (diff)
downloadchromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.zip
chromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.tar.gz
chromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.tar.bz2
Linux: fix icon theme double free on shutdown by eliminating dupes from icon theme array.
Simplify some code in DownloadItemGtk that I previously thought was related to the crash, and so had made complicated. Review URL: http://codereview.chromium.org/124001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/download_item_gtk.cc10
-rw-r--r--chrome/browser/gtk/download_item_gtk.h4
2 files changed, 4 insertions, 10 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.cc b/chrome/browser/gtk/download_item_gtk.cc
index 619aed5..1f0d814 100644
--- a/chrome/browser/gtk/download_item_gtk.cc
+++ b/chrome/browser/gtk/download_item_gtk.cc
@@ -250,9 +250,8 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf,
gtk_box_pack_start(GTK_BOX(shelf_hbox), hbox_.get(), FALSE, FALSE, 0);
// Insert as the leftmost item.
gtk_box_reorder_child(GTK_BOX(shelf_hbox), hbox_.get(), 1);
-
- resize_handler_id_ = g_signal_connect(G_OBJECT(shelf_hbox), "size-allocate",
- G_CALLBACK(OnShelfResized), this);
+ g_signal_connect(G_OBJECT(shelf_hbox), "size-allocate",
+ G_CALLBACK(OnShelfResized), this);
get_download()->AddObserver(this);
@@ -346,6 +345,8 @@ DownloadItemGtk::DownloadItemGtk(DownloadShelfGtk* parent_shelf,
DownloadItemGtk::~DownloadItemGtk() {
StopDownloadProgress();
get_download()->RemoveObserver(this);
+ g_signal_handlers_disconnect_by_func(parent_shelf_->GetHBox(),
+ reinterpret_cast<gpointer>(OnShelfResized), this);
hbox_.Destroy();
progress_area_.Destroy();
@@ -365,9 +366,6 @@ void DownloadItemGtk::OnDownloadUpdated(DownloadItem* download) {
switch (download->state()) {
case DownloadItem::REMOVING:
- // We disconnect here rather than the d'tor because we don't want to
- // explicitly disconnect if |parent_shelf_| has been destroyed.
- g_signal_handler_disconnect(parent_shelf_->GetHBox(), resize_handler_id_);
parent_shelf_->RemoveDownloadItem(this); // This will delete us!
return;
case DownloadItem::CANCELLED:
diff --git a/chrome/browser/gtk/download_item_gtk.h b/chrome/browser/gtk/download_item_gtk.h
index e2fbf10..832302e 100644
--- a/chrome/browser/gtk/download_item_gtk.h
+++ b/chrome/browser/gtk/download_item_gtk.h
@@ -154,10 +154,6 @@ class DownloadItemGtk : public DownloadItem::Observer,
int dangerous_hbox_start_width_;
int dangerous_hbox_full_width_;
- // The ID of the handler for the parent shelf's "size-allocate" event. We save
- // it so we can disconnect when we are destroyed.
- gulong resize_handler_id_;
-
// The animation when this item is first added to the shelf.
scoped_ptr<SlideAnimation> new_item_animation_;