File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,12 @@ static void
902
902
remove_tab (XedTab * tab ,
903
903
XedNotebook * nb )
904
904
{
905
+ /* First cancel any loading */
906
+ if (xed_tab_get_state (tab ) == XED_TAB_STATE_LOADING )
907
+ {
908
+ _xed_tab_cancel_load (tab );
909
+ }
910
+
905
911
gint position ;
906
912
907
913
position = gtk_notebook_page_num (GTK_NOTEBOOK (nb ), GTK_WIDGET (tab ));
Original file line number Diff line number Diff line change @@ -1994,6 +1994,15 @@ _xed_tab_load (XedTab *tab,
1994
1994
load (tab , encoding , line_pos );
1995
1995
}
1996
1996
1997
+ void
1998
+ _xed_tab_cancel_load (XedTab * tab )
1999
+ {
2000
+ g_return_if_fail (XED_IS_PROGRESS_INFO_BAR (tab -> priv -> info_bar ));
2001
+ g_return_if_fail (G_IS_CANCELLABLE (tab -> priv -> cancellable ));
2002
+
2003
+ g_cancellable_cancel (tab -> priv -> cancellable );
2004
+ }
2005
+
1997
2006
void
1998
2007
_xed_tab_load_stream (XedTab * tab ,
1999
2008
GInputStream * stream ,
Original file line number Diff line number Diff line change @@ -129,6 +129,8 @@ void _xed_tab_load (XedTab *tab,
129
129
gint line_pos ,
130
130
gboolean create );
131
131
132
+ void _xed_tab_cancel_load (XedTab * tab );
133
+
132
134
void _xed_tab_load_stream (XedTab * tab ,
133
135
GInputStream * location ,
134
136
const GtkSourceEncoding * encoding ,
You can’t perform that action at this time.
0 commit comments