ObjFW  Diff

Differences From Artifact [9d548c4f33]:

  • File src/OFZIPArchive.m — part of check-in [6527c97d03] at 2022-10-09 16:19:17 on branch trunk — OFZIPArchive: Make returned streams retain archive

    In order to not create a retain cycle, this changes the reference to the
    last returned stream to an unsafe unretained one that the stream itself
    needs to reset to nil in its dealloc.

    Since when closing a stream for writing the archive needs to be updated,
    the code for that was moved out of OFZIPArchive and into the stream
    writer, since it now has a reference to the archive anyway. (user: js, size: 24622) [annotate] [blame] [check-ins using]

To Artifact [7434ba6daa]:


172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode
{
	return [[[self alloc] initWithURI: URI mode: mode] autorelease];
}

+ (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive
{
	return OFArchiveURIHandlerURIForFileInArchive(@"of-zip", path, archive);
}

- (instancetype)init
{
	OF_INVALID_INIT_METHOD
}








|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
+ (instancetype)archiveWithURI: (OFURI *)URI mode: (OFString *)mode
{
	return [[[self alloc] initWithURI: URI mode: mode] autorelease];
}

+ (OFURI *)URIForFile: (OFString *)path inArchive: (OFURI *)archive
{
	return OFArchiveURIHandlerURIForFileInArchive(@"zip", path, archive);
}

- (instancetype)init
{
	OF_INVALID_INIT_METHOD
}