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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user