Commit b595fe3f authored by Paolo Borelli's avatar Paolo Borelli

Paolo Borelli <pborelli@katamail.com>

	* gedit/gedit-view.c: be robust to the case where the view is destroyed
	before the idle-scroll-to-line hack runs.
	* gedit/gedit-tab.c: check for NULLness before destroying a GTimer.
parent d82bea5d
2006-02-12 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-view.c: be robust to the case where the view is destroyed
before the idle-scroll-to-line hack runs.
* gedit/gedit-tab.c: check for NULLness before destroying a GTimer.
2006-02-12 Paolo Maggi <paolo@gnome.org>
* gedit/gedit-utils.c (gedit_utils_make_valid_utf8): replace
......
......@@ -881,9 +881,12 @@ document_loaded (GeditDocument *document,
g_return_if_fail ((tab->priv->state == GEDIT_TAB_STATE_LOADING) ||
(tab->priv->state == GEDIT_TAB_STATE_REVERTING));
g_return_if_fail (tab->priv->auto_save_timeout <= 0);
g_timer_destroy (tab->priv->timer);
tab->priv->timer = NULL;
if (tab->priv->timer != NULL)
{
g_timer_destroy (tab->priv->timer);
tab->priv->timer = NULL;
}
tab->priv->times_called = 0;
set_message_area (tab, NULL);
......
......@@ -64,6 +64,9 @@ typedef enum
struct _GeditViewPrivate
{
GtkTooltips *tooltips;
/* idle hack to make open-at-line work */
guint scroll_idle;
SearchMode search_mode;
......@@ -316,6 +319,7 @@ scroll_to_cursor_on_init (GeditView *view)
{
gedit_view_scroll_to_cursor (view);
view->priv->scroll_idle = 0;
return FALSE;
}
......@@ -380,7 +384,7 @@ gedit_view_init (GeditView *view)
* possible: see bug #172277 and bug #311728.
* So we need to do this in an idle handler.
*/
g_idle_add ((GSourceFunc) scroll_to_cursor_on_init, view);
view->priv->scroll_idle = g_idle_add ((GSourceFunc) scroll_to_cursor_on_init, view);
view->priv->typeselect_flush_timeout = 0;
view->priv->wrap_around = TRUE;
......@@ -420,6 +424,9 @@ gedit_view_finalize (GObject *object)
if (view->priv->tooltips != NULL)
g_object_unref (view->priv->tooltips);
if (view->priv->scroll_idle > 0)
g_source_remove (view->priv->scroll_idle);
(* G_OBJECT_CLASS (gedit_view_parent_class)->finalize) (object);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment