[gedit] tab: Remove tab before unreffing the loading_task data



commit c089321c58b5aae98183e257c2b7a372e754a15f
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Tue Apr 16 18:31:40 2019 +0100

    tab: Remove tab before unreffing the loading_task data
    
    When there is a problem opening a file, if the user decides to dismiss the tab
    clicking the 'x' button in the info bar, remove the tab before unreffing the
    loading_task data. Failing to do so will likely result in an access to invalid
    memory.

 gedit/gedit-tab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 21f55eb48..02d243714 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -694,10 +694,10 @@ io_loading_error_info_bar_response (GtkWidget *info_bar,
                                gedit_recent_remove_if_local (location);
                        }
 
+                       remove_tab (data->tab);
+
                        g_task_return_boolean (loading_task, FALSE);
                        g_object_unref (loading_task);
-
-                       remove_tab (data->tab);
                        break;
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]