aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-31 10:02:55 +0100
committerMax Kellermann <max@duempel.org>2009-12-31 18:27:35 +0100
commitaad05fd1386442330ecc0a15b86cf8081ea47c83 (patch)
tree66e9063f50b1c78cb8dda928e511f84f02f95891 /src/input
parent032c5376ad0ad8dca135d210363ef8e454e11167 (diff)
downloadmpd-aad05fd1386442330ecc0a15b86cf8081ea47c83.tar.gz
mpd-aad05fd1386442330ecc0a15b86cf8081ea47c83.tar.xz
mpd-aad05fd1386442330ecc0a15b86cf8081ea47c83.zip
archive: use reference counting for archive+input
Make the input_stream implementation hold a reference on the archive_file object. Allow the caller to "close" the archive_file object immediately, no matter if the open_stream() method has succeeded or not.
Diffstat (limited to '')
-rw-r--r--src/input/archive_input_plugin.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/input/archive_input_plugin.c b/src/input/archive_input_plugin.c
index 248b8626e..0409057bb 100644
--- a/src/input/archive_input_plugin.c
+++ b/src/input/archive_input_plugin.c
@@ -67,12 +67,9 @@ input_archive_open(struct input_stream *is, const char *pathname,
//setup fileops
opened = archive_file_open_stream(file, is, filename, error_r);
+ archive_file_close(file);
g_free(pname);
- if (!opened) {
- archive_file_close(file);
- }
-
return opened;
}