aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2005-10-09 05:00:50 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-09 05:00:50 +0800
commita57179cd0a6814c6e08eef31d671061df1d5af73 (patch)
tree671175095fe8718f115487c44f8206453c5e995a /lib
parent12c604caf1667770159e18b3e09c18b9fac95909 (diff)
downloadgsoc2013-epiphany-a57179cd0a6814c6e08eef31d671061df1d5af73.tar.gz
gsoc2013-epiphany-a57179cd0a6814c6e08eef31d671061df1d5af73.tar.zst
gsoc2013-epiphany-a57179cd0a6814c6e08eef31d671061df1d5af73.zip
Ensure the images are loaded before starting to spin. Should fix crashes
* lib/widgets/ephy-spinner.c: (ephy_spinner_start), (ephy_spinner_dispose), (ephy_spinner_finalize), (ephy_spinner_class_init): Ensure the images are loaded before starting to spin. Should fix crashes on start/new tab.
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-spinner.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c
index 2cdc809d1..5ae2876f2 100644
--- a/lib/widgets/ephy-spinner.c
+++ b/lib/widgets/ephy-spinner.c
@@ -740,17 +740,17 @@ ephy_spinner_start (EphySpinner *spinner)
details->spinning = TRUE;
if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) &&
- details->timer_task == 0)
+ details->timer_task == 0 &&
+ ephy_spinner_load_images (spinner))
+
{
-
- if (spinner->details->images != NULL)
+ if (details->images != NULL)
{
/* reset to first frame */
- spinner->details->current_image =
- spinner->details->images->images;
+ details->current_image = details->images->images;
}
- spinner->details->timer_task =
+ details->timer_task =
g_timeout_add (details->timeout,
(GSourceFunc) bump_spinner_frame_cb,
spinner);
@@ -893,7 +893,7 @@ ephy_spinner_unmap (GtkWidget *widget)
}
static void
-ephy_spinner_finalize (GObject *object)
+ephy_spinner_dispose (GObject *object)
{
EphySpinner *spinner = EPHY_SPINNER (object);
@@ -901,6 +901,14 @@ ephy_spinner_finalize (GObject *object)
(spinner->details->icon_theme,
G_CALLBACK (icon_theme_changed_cb), spinner);
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+ephy_spinner_finalize (GObject *object)
+{
+ EphySpinner *spinner = EPHY_SPINNER (object);
+
ephy_spinner_remove_update_callback (spinner);
ephy_spinner_unload_images (spinner);
@@ -954,6 +962,7 @@ ephy_spinner_class_init (EphySpinnerClass *class)
parent_class = g_type_class_peek_parent (class);
+ object_class->dispose = ephy_spinner_dispose;
object_class->finalize = ephy_spinner_finalize;
widget_class->expose_event = ephy_spinner_expose;