Commit dcbade4c authored by Darin Adler's avatar Darin Adler
Browse files

Fixed the bug where bogus URIs would cause a seg fault. Unfortunately

	* src/nautilus-window-manage-views.c:
	(nautilus_window_end_location_change_callback),
	(nautilus_window_begin_location_change):
	* src/nautilus-window.h:
	Fixed the bug where bogus URIs would cause a seg fault.
	Unfortunately doing this in a simple clean way required
	adding a field to the already-packed NautilusWindow.
parent 8d38bd9b
2000-06-08 Darin Adler <darin@eazel.com>
* src/nautilus-window-manage-views.c:
(nautilus_window_end_location_change_callback),
(nautilus_window_begin_location_change):
* src/nautilus-window.h:
Fixed the bug where bogus URIs would cause a seg fault.
Unfortunately doing this in a simple clean way required
adding a field to the already-packed NautilusWindow.
2000-06-08 Pavel <pavel@eazel.com>
* components/services/time/command-line/Makefile.am:
......
......@@ -116,6 +116,8 @@ struct _NautilusWindow {
enum { NW_LOADING_INFO, NW_LOADING_VIEWS, NW_IDLE } state;
NautilusNavigationInfo *cancel_tag;
gboolean location_change_end_reached;
guint action_tag;
guint16 made_changes, making_changes;
......
......@@ -116,6 +116,8 @@ struct _NautilusWindow {
enum { NW_LOADING_INFO, NW_LOADING_VIEWS, NW_IDLE } state;
NautilusNavigationInfo *cancel_tag;
gboolean location_change_end_reached;
guint action_tag;
guint16 made_changes, making_changes;
......
......@@ -116,6 +116,8 @@ struct _NautilusWindow {
enum { NW_LOADING_INFO, NW_LOADING_VIEWS, NW_IDLE } state;
NautilusNavigationInfo *cancel_tag;
gboolean location_change_end_reached;
guint action_tag;
guint16 made_changes, making_changes;
......
......@@ -1106,7 +1106,7 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co
g_assert (navi != NULL);
window->cancel_tag = NULL;
window->location_change_end_reached = TRUE;
if (result_code == NAUTILUS_NAVIGATION_RESULT_OK) {
/* Navigation successful. Show the window to handle the
......@@ -1114,6 +1114,7 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co
* Maybe this should go sometime later so the blank window isn't
* on screen so long.
*/
window->cancel_tag = navi;
gtk_widget_show (GTK_WIDGET (window));
nautilus_window_set_state_info (window,
(NautilusWindowStateItem)NAVINFO_RECEIVED,
......@@ -1168,6 +1169,10 @@ nautilus_window_end_location_change_callback (NautilusNavigationResult result_co
}
if (navi != NULL) {
if (window->cancel_tag != NULL) {
g_assert (window->cancel_tag == navi);
window->cancel_tag = NULL;
}
nautilus_navigation_info_free (navi);
}
......@@ -1205,6 +1210,7 @@ nautilus_window_begin_location_change (NautilusWindow *window,
guint distance)
{
const char *current_iid;
NautilusNavigationInfo *navigation_info;
g_assert (NAUTILUS_IS_WINDOW (window));
g_assert (loc != NULL);
......@@ -1234,8 +1240,17 @@ nautilus_window_begin_location_change (NautilusWindow *window,
current_iid = nautilus_view_frame_get_iid (window->content_view);
}
window->cancel_tag = nautilus_navigation_info_new
/* If we just set the cancel tag in the obvious way here we run into
* a problem where the cancel tag is set to point to bogus data.
* To reproduce this problem, just use any illegal URI.
*/
g_assert (window->cancel_tag == NULL);
window->location_change_end_reached = FALSE;
navigation_info = nautilus_navigation_info_new
(loc, window->ni,
nautilus_window_end_location_change_callback,
window, current_iid);
if (!window->location_change_end_reached) {
window->cancel_tag = navigation_info;
}
}
......@@ -116,6 +116,8 @@ struct _NautilusWindow {
enum { NW_LOADING_INFO, NW_LOADING_VIEWS, NW_IDLE } state;
NautilusNavigationInfo *cancel_tag;
gboolean location_change_end_reached;
guint action_tag;
guint16 made_changes, making_changes;
......
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