glib2/timezone-madness.patch
Michael Catanzaro 6c5949a8ca Use smaller patches for the timezone issues
Someone just found a bug in the big version of the fix, so let's use a
smaller fix until these are both accepted upstream.
2020-10-14 15:31:02 -05:00

47 lines
1.5 KiB
Diff

From c355b0970521bd8b3e5f4fee6a2a170c65b9d723 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@gnome.org>
Date: Wed, 14 Oct 2020 15:30:18 -0500
Subject: [PATCH] Revert "gtimezone: Cache timezones based on the identifier
they were created by"
This reverts commit 851241f19a3fd9ec693b3dd8f37a84c7f970984a.
---
glib/gtimezone.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/glib/gtimezone.c b/glib/gtimezone.c
index ef67ec50b..8e0621e54 100644
--- a/glib/gtimezone.c
+++ b/glib/gtimezone.c
@@ -196,7 +196,6 @@ struct _GTimeZone
G_LOCK_DEFINE_STATIC (time_zones);
static GHashTable/*<string?, GTimeZone>*/ *time_zones;
G_LOCK_DEFINE_STATIC (tz_local);
-static gchar *tzenv_cached = NULL;
static GTimeZone *tz_local = NULL;
#define MIN_TZYEAR 1916 /* Daylight Savings started in WWI */
@@ -1843,17 +1842,11 @@ g_time_zone_new_local (void)
G_LOCK (tz_local);
/* Is time zone changed and must be flushed? */
- if (tz_local && g_strcmp0 (tzenv, tzenv_cached) != 0)
- {
- g_clear_pointer (&tz_local, g_time_zone_unref);
- g_clear_pointer (&tzenv_cached, g_free);
- }
+ if (tz_local && g_strcmp0 (g_time_zone_get_identifier (tz_local), tzenv))
+ g_clear_pointer (&tz_local, g_time_zone_unref);
if (tz_local == NULL)
- {
- tz_local = g_time_zone_new (tzenv);
- tzenv_cached = g_strdup (tzenv);
- }
+ tz_local = g_time_zone_new (tzenv);
tz = g_time_zone_ref (tz_local);
--
2.28.0