diff --git a/zathura/utils.c b/zathura/utils.c index 7e187c61..8e0f381c 100644 --- a/zathura/utils.c +++ b/zathura/utils.c @@ -141,6 +141,7 @@ void index_scroll_to_current_page(zathura_t* zathura) { gtk_tree_model_foreach(model, search_current_index, &search_data); GtkTreePath* current_path = gtk_tree_model_get_path(model, &search_data.current_iter); + g_free(zathura->global.current_index_path); zathura->global.current_index_path = gtk_tree_path_to_string(current_path); gtk_tree_view_expand_to_path(tree_view, current_path); diff --git a/zathura/zathura.c b/zathura/zathura.c index 244989f7..6230a109 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -1513,6 +1513,9 @@ bool document_close(zathura_t* zathura, bool keep_monitor) { zathura->ui.index = NULL; } + /* free current index path */ + g_free(zathura->global.current_index_path); + gtk_widget_hide(zathura->ui.page_widget); statusbar_page_number_update(zathura); @@ -1808,4 +1811,4 @@ void zathura_set_log_level(const char* loglevel) { } else if (g_strcmp0(loglevel, "debug") == 0) { girara_set_log_level(GIRARA_DEBUG); } -} \ No newline at end of file +} diff --git a/zathura/zathura.h b/zathura/zathura.h index 604246ff..21f7da92 100644 --- a/zathura/zathura.h +++ b/zathura/zathura.h @@ -139,7 +139,7 @@ struct zathura_s { GdkModifierType synctex_edit_modmask; /**< Modifier to trigger synctex edit */ GdkModifierType highlighter_modmask; /**< Modifier to draw with a highlighter */ bool double_click_follow; /**< Double/Single click to follow link */ - char *current_index_path; + gchar *current_index_path; } global; struct {