Backport a patch to fix memory and D-Bus match rule leaks

This commit is contained in:
Kalev Lember 2018-03-16 20:54:11 +01:00
parent b215a87a82
commit 87b3c01913
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 5236ce83f1c56cf81f4a7988dcfe3fd7e3c7ee1a Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 15 Mar 2018 14:42:15 +0100
Subject: [PATCH] lib: Fix memory and D-Bus match rule leaks
From #3:
> The GWeatherInfo settings object is never freed leading not only
> to a memory leak, but also to a dbus match rule leak, which on
> the system bus can quickly result in reaching the maximum amount
> of allowed match rules. See gnome-shell#96.
---
libgweather/gweather-weather.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index 6ece6562d45b..571a3e0b7f10 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -738,6 +738,7 @@ gweather_info_finalize (GObject *object)
GWeatherInfoPrivate *priv = info->priv;
_weather_location_free (&priv->location);
+ g_clear_object (&priv->settings);
if (priv->glocation)
gweather_location_unref (priv->glocation);
--
2.16.2

View File

@ -1,11 +1,13 @@
Name: libgweather
Version: 3.28.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A library for weather information
License: GPLv2+
URL: https://wiki.gnome.org/Projects/LibGWeather
Source0: https://download.gnome.org/sources/libgweather/3.28/%{name}-%{version}.tar.xz
# Backported from upstream
Patch0: 0001-lib-Fix-memory-and-D-Bus-match-rule-leaks.patch
BuildRequires: gettext
BuildRequires: gtk-doc
@ -70,6 +72,9 @@ developing applications that use %{name}.
%{_datadir}/vala/vapi/gweather-3.0.vapi
%changelog
* Fri Mar 16 2018 Kalev Lember <klember@redhat.com> - 3.28.0-2
- Backport a patch to fix memory and D-Bus match rule leaks
* Sun Mar 11 2018 Kalev Lember <klember@redhat.com> - 3.28.0-1
- Update to 3.28.0