diff options
| author | Michael Biebl <biebl@debian.org> | 2024-02-13 22:23:40 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2024-02-13 22:23:40 +0100 |
| commit | 6681f77b757bbc42ce5c8868ee9142b7ebc8c059 (patch) | |
| tree | f713e759b7c255ebeea83351f05dd466fd31422f /src/libnm-glib-aux/nm-ref-string.h | |
| parent | 70e18d99b8e3e77bb37e218d7ac582130156f8ef (diff) | |
New upstream version 1.45.91 upstream/1.45.91
Diffstat (limited to 'src/libnm-glib-aux/nm-ref-string.h')
| -rw-r--r-- | src/libnm-glib-aux/nm-ref-string.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libnm-glib-aux/nm-ref-string.h b/src/libnm-glib-aux/nm-ref-string.h index c7cfe87f..45313b39 100644 --- a/src/libnm-glib-aux/nm-ref-string.h +++ b/src/libnm-glib-aux/nm-ref-string.h @@ -83,7 +83,8 @@ nm_ref_string_unref(NMRefString *rstr) /* fast-path: first try to decrement the ref-count without bringing it * to zero. */ - r = rstr->_ref_count; + r = g_atomic_int_get(&rstr->_ref_count); + if (G_LIKELY(r > 1 && g_atomic_int_compare_and_exchange(&rstr->_ref_count, r, r - 1))) return; |