From aad05fd1386442330ecc0a15b86cf8081ea47c83 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 31 Dec 2009 10:02:55 +0100 Subject: 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. --- src/input/archive_input_plugin.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/input') 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; } -- cgit v1.2.3