diff options
| author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-20 18:34:08 +0100 |
|---|---|---|
| committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-01-20 18:34:08 +0100 |
| commit | d7d62ea5ee19f5cad52dcfb2f2a49d8d36fa1228 (patch) | |
| tree | acceeed18451fd1ff982f3108ace88b77df82c18 /src/lib | |
| parent | 0e7e088d6faec43234e1f967b6e1e853cb9fedf1 (diff) | |
| download | abrt-d7d62ea5ee19f5cad52dcfb2f2a49d8d36fa1228.tar.gz abrt-d7d62ea5ee19f5cad52dcfb2f2a49d8d36fa1228.tar.xz abrt-d7d62ea5ee19f5cad52dcfb2f2a49d8d36fa1228.zip | |
introduce and use new helper function list_free_with_free
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Makefile.am | 1 | ||||
| -rw-r--r-- | src/lib/abrt_dbus.c | 1 | ||||
| -rw-r--r-- | src/lib/abrt_dbus.h | 1 | ||||
| -rw-r--r-- | src/lib/glib_support.c | 26 |
4 files changed, 27 insertions, 2 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 20fbd4ed..ce06795a 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -32,6 +32,7 @@ libreport_la_SOURCES = \ dirsize.c \ dump_dir.c \ get_cmdline.c \ + glib_support.c \ daemon_is_ok.c \ load_plugin_settings.c \ make_descr.c \ diff --git a/src/lib/abrt_dbus.c b/src/lib/abrt_dbus.c index 69ac1241..d1717636 100644 --- a/src/lib/abrt_dbus.c +++ b/src/lib/abrt_dbus.c @@ -17,7 +17,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <dbus/dbus.h> -#include <glib.h> #include "abrtlib.h" #include "abrt_dbus.h" diff --git a/src/lib/abrt_dbus.h b/src/lib/abrt_dbus.h index d8cc3aa8..2723555c 100644 --- a/src/lib/abrt_dbus.h +++ b/src/lib/abrt_dbus.h @@ -20,7 +20,6 @@ #define ABRT_DBUS_H #include <dbus/dbus.h> -#include <glib.h> #include "abrtlib.h" diff --git a/src/lib/glib_support.c b/src/lib/glib_support.c new file mode 100644 index 00000000..feb4c18b --- /dev/null +++ b/src/lib/glib_support.c @@ -0,0 +1,26 @@ +/* + Copyright (C) 2011 ABRT team + Copyright (C) 2011 RedHat Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ +#include "abrtlib.h" + +void list_free_with_free(GList *list) +{ + for (GList *li = list; li; li = g_list_next(li)) + free(li->data); + g_list_free(list); +} |
