summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2021-09-27 15:07:52 -0400
committerRay Strode <rstrode@redhat.com>2021-09-27 15:11:10 -0400
commit624af5fed418c2be0939f42e75c4e9c4744d98d7 (patch)
treefde48bb6b8981bd0e5e5fa045c881ead7a09e39d
parentbca5d2effccfc3f2ecd53d002a23d9cf6156a9f7 (diff)
downloadgedit-fix-open-crash.tar.gz
open-selector: Fix crash introduced in GDateTime portfix-open-crash
commit acf14cc04f1e66c4c726d9a0b193bf39a28ca8b0 moved FileItems over to using GDateTime instead of GTimeVal. This reduced code complexity pretty nicely, but it unfortunately introduced a bug, where the sort_items_by_mru function was treating the FileItems themselves as GDateTime objects. That bug causes a crash when opening files. This commit fixes the problem by using the ->accessed members instead of the file items themselves. Closes: https://gitlab.gnome.org/GNOME/gedit/-/issues/465
-rw-r--r--gedit/gedit-open-document-selector.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gedit/gedit-open-document-selector.c b/gedit/gedit-open-document-selector.c
index bc3d0548d..e46f01568 100644
--- a/gedit/gedit-open-document-selector.c
+++ b/gedit/gedit-open-document-selector.c
@@ -312,7 +312,7 @@ sort_items_by_mru (FileItem *a,
{
g_assert (a != NULL && b != NULL);
- return g_date_time_compare (b, a);
+ return g_date_time_compare (b->accessed, a->accessed);
}
static GList *