85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
+
+
+
+
|
bool append;
} *firstHandle = NULL;
static void
closeHandle(OFFileHandle handle)
{
Close(handle->handle);
Forbid();
if (handle->previous != NULL)
handle->previous->next = handle->next;
if (handle->next != NULL)
handle->next->previous = handle->previous;
if (firstHandle == handle)
firstHandle = handle->next;
Permit();
OFFreeMemory(handle);
}
OF_DESTRUCTOR()
{
for (OFFileHandle iter = firstHandle; iter != NULL;
|
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
+
+
+
+
|
Close(handle->handle);
@throw [OFOpenItemFailedException
exceptionWithPath: path
mode: mode
errNo: EIO];
}
}
Forbid();
handle->previous = NULL;
handle->next = firstHandle;
if (firstHandle != NULL)
firstHandle->previous = handle;
firstHandle = handle;
Permit();
} @catch (id e) {
OFFreeMemory(handle);
@throw e;
}
#endif
objc_autoreleasePoolPop(pool);
|