Trying to insure eventual gc cleanup
This commit is contained in:
parent
3a6f0f7478
commit
b62b5040c7
@ -18,7 +18,7 @@ from ...widgets.icon_tree_widget import IconTreeWidget
|
||||
class GridMixin:
|
||||
"""docstring for GridMixin"""
|
||||
|
||||
def load_store(self, tab, store, save_state=False):
|
||||
def load_store(self, tab, store, save_state = False):
|
||||
store.clear()
|
||||
dir = tab.get_current_directory()
|
||||
files = tab.get_files()
|
||||
|
@ -52,23 +52,41 @@ class TabMixin(GridMixin):
|
||||
|
||||
|
||||
|
||||
def close_tab(self, button, eve=None):
|
||||
def close_tab(self, button, eve = None):
|
||||
notebook = button.get_parent().get_parent()
|
||||
if notebook.get_n_pages() == 1:
|
||||
return
|
||||
|
||||
tab_box = button.get_parent()
|
||||
wid = int(notebook.get_name()[-1])
|
||||
tid = self.get_id_from_tab_box(button.get_parent())
|
||||
tid = self.get_id_from_tab_box(tab_box)
|
||||
scroll = self.builder.get_object(f"{wid}|{tid}")
|
||||
page = notebook.page_num(scroll)
|
||||
icon_grid = scroll.get_children()[0]
|
||||
store = icon_grid.get_model()
|
||||
page_num = notebook.page_num(scroll)
|
||||
tab = self.get_fm_window(wid).get_tab_by_id(tid)
|
||||
watcher = tab.get_dir_watcher()
|
||||
|
||||
watcher.cancel()
|
||||
self.get_fm_window(wid).delete_tab_by_id(tid)
|
||||
notebook.remove_page(page)
|
||||
|
||||
store.clear()
|
||||
icon_grid.destroy()
|
||||
scroll.destroy()
|
||||
tab_box.destroy()
|
||||
notebook.remove_page(page_num)
|
||||
|
||||
del page_num
|
||||
del store
|
||||
del icon_grid
|
||||
del scroll
|
||||
del tab_box
|
||||
del watcher
|
||||
del tab
|
||||
|
||||
if not settings.is_trace_debug():
|
||||
self.fm_controller.save_state()
|
||||
|
||||
self.set_window_title()
|
||||
|
||||
# NOTE: Not actually getting called even tho set in the glade file...
|
||||
|
@ -52,21 +52,41 @@ class TabMixin(GridMixin):
|
||||
self.set_file_watcher(tab)
|
||||
|
||||
|
||||
def close_tab(self, button, eve=None):
|
||||
def close_tab(self, button, eve = None):
|
||||
notebook = button.get_parent().get_parent()
|
||||
if notebook.get_n_pages() == 1:
|
||||
return
|
||||
|
||||
tab_box = button.get_parent()
|
||||
wid = int(notebook.get_name()[-1])
|
||||
tid = self.get_id_from_tab_box(button.get_parent())
|
||||
tid = self.get_id_from_tab_box(tab_box)
|
||||
scroll = self.builder.get_object(f"{wid}|{tid}")
|
||||
page = notebook.page_num(scroll)
|
||||
icon_grid = scroll.get_children()[0]
|
||||
store = icon_grid.get_model()
|
||||
page_num = notebook.page_num(scroll)
|
||||
tab = self.get_fm_window(wid).get_tab_by_id(tid)
|
||||
watcher = tab.get_dir_watcher()
|
||||
|
||||
watcher.cancel()
|
||||
self.get_fm_window(wid).delete_tab_by_id(tid)
|
||||
notebook.remove_page(page)
|
||||
|
||||
icon_grid = scroll.get_children()[0]
|
||||
store = icon_grid.get_model()
|
||||
|
||||
store.clear()
|
||||
icon_grid.destroy()
|
||||
scroll.destroy()
|
||||
tab_box.destroy()
|
||||
notebook.remove_page(page_num)
|
||||
|
||||
del page_num
|
||||
del store
|
||||
del icon_grid
|
||||
del scroll
|
||||
del tab_box
|
||||
del watcher
|
||||
del tab
|
||||
|
||||
if not settings.is_trace_debug():
|
||||
self.fm_controller.save_state()
|
||||
self.set_window_title()
|
||||
|
Loading…
Reference in New Issue
Block a user