Line 0
Link Here
|
|
|
1 |
--- glib/gtimezone.c.orig 2018-09-21 12:29:23.000000000 +0300 |
2 |
+++ glib/gtimezone.c 2019-09-12 00:53:42.760936000 +0300 |
3 |
@@ -1460,7 +1470,10 @@ |
4 |
GTimeZone * |
5 |
g_time_zone_new_utc (void) |
6 |
{ |
7 |
- return g_time_zone_new ("UTC"); |
8 |
+ GTimeZone *tz = g_time_zone_new ("UTC"); |
9 |
+ if (tz != NULL && tz->name != NULL) |
10 |
+ g_atomic_int_inc (&tz->ref_count); /* Cache infinite. */ |
11 |
+ return tz; |
12 |
} |
13 |
|
14 |
/** |
15 |
@@ -1483,7 +1496,10 @@ |
16 |
GTimeZone * |
17 |
g_time_zone_new_local (void) |
18 |
{ |
19 |
- return g_time_zone_new (getenv ("TZ")); |
20 |
+ GTimeZone *tz = g_time_zone_new (getenv ("TZ")); |
21 |
+ if (tz != NULL && tz->name != NULL) |
22 |
+ g_atomic_int_inc (&tz->ref_count); /* Cache infinite. */ |
23 |
+ return tz; |
24 |
} |
25 |
|
26 |
#define TRANSITION(n) g_array_index (tz->transitions, Transition, n) |