ObjFW  Check-in [d80e2fb1bc]

Overview
Comment:Release local objects before releasing self in @catch.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d80e2fb1bc2f7102914ef306a1b39903ad668705fe4ea4dc26de59f2347542c4
User & Date: js on 2009-12-23 22:36:14
Other Links: manifest | tags
Context
2009-12-23
22:38
Throw an exception when trying to use chown on Windows. check-in: 6cd75d4826 user: js tags: trunk
22:36
Release local objects before releasing self in @catch. check-in: d80e2fb1bc user: js tags: trunk
22:30
Documentation improvements. check-in: 19ac0520ae user: js tags: trunk
Changes

Modified src/OFDictionary.m from [09f88deaa1] to [67a9356465].

131
132
133
134
135
136
137
138
139

140
141
142
143
144
145
146
			[self dealloc];
			@throw e;
		}

		@try {
			[dict->data[i].object retain];
		} @catch (OFException *e) {
			[self dealloc];
			[key release];

			@throw e;
		}

		data[i].key = key;
		data[i].object = dict->data[i].object;
		data[i].hash = dict->data[i].hash;
	}







<

>







131
132
133
134
135
136
137

138
139
140
141
142
143
144
145
146
			[self dealloc];
			@throw e;
		}

		@try {
			[dict->data[i].object retain];
		} @catch (OFException *e) {

			[key release];
			[self dealloc];
			@throw e;
		}

		data[i].key = key;
		data[i].object = dict->data[i].object;
		data[i].hash = dict->data[i].hash;
	}
159
160
161
162
163
164
165
166
167

168
169
170
171
172
173
174
		[self dealloc];
		@throw e;
	}

	@try {
		[obj retain];
	} @catch (OFException *e) {
		[self dealloc];
		[key release];

		@throw e;
	}

	data[0].key = key;
	data[0].object = obj;
	data[0].hash = [key hash];








<

>







159
160
161
162
163
164
165

166
167
168
169
170
171
172
173
174
		[self dealloc];
		@throw e;
	}

	@try {
		[obj retain];
	} @catch (OFException *e) {

		[key release];
		[self dealloc];
		@throw e;
	}

	data[0].key = key;
	data[0].object = obj;
	data[0].hash = [key hash];

242
243
244
245
246
247
248
249
250

251
252
253
254
255
256
257
				[self dealloc];
				@throw e;
			}

			@try {
				[objs_carray[i] retain];
			} @catch (OFException *e) {
				[self dealloc];
				[key release];

				@throw e;
			}

			data[j].key = key;
			data[j].object = objs_carray[i];
			data[j].hash = hash;








<

>







242
243
244
245
246
247
248

249
250
251
252
253
254
255
256
257
				[self dealloc];
				@throw e;
			}

			@try {
				[objs_carray[i] retain];
			} @catch (OFException *e) {

				[key release];
				[self dealloc];
				@throw e;
			}

			data[j].key = key;
			data[j].object = objs_carray[i];
			data[j].hash = hash;

269
270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
			[self dealloc];
			@throw e;
		}

		@try {
			[data[j].object release];
		} @catch (OFException *e) {
			[self dealloc];
			[objs_carray[i] release];

			@throw e;
		}

		data[j].object = objs_carray[i];
	}

	return self;







<

>







269
270
271
272
273
274
275

276
277
278
279
280
281
282
283
284
			[self dealloc];
			@throw e;
		}

		@try {
			[data[j].object release];
		} @catch (OFException *e) {

			[objs_carray[i] release];
			[self dealloc];
			@throw e;
		}

		data[j].object = objs_carray[i];
	}

	return self;
353
354
355
356
357
358
359
360
361

362
363
364
365
366
367
368
		[self dealloc];
		@throw e;
	}

	@try {
		[obj retain];
	} @catch (OFException *e) {
		[self dealloc];
		[key release];

		@throw e;
	}

	data[j].key = key;
	data[j].object = obj;
	data[j].hash = hash;








<

>







353
354
355
356
357
358
359

360
361
362
363
364
365
366
367
368
		[self dealloc];
		@throw e;
	}

	@try {
		[obj retain];
	} @catch (OFException *e) {

		[key release];
		[self dealloc];
		@throw e;
	}

	data[j].key = key;
	data[j].object = obj;
	data[j].hash = hash;

408
409
410
411
412
413
414
415
416

417
418
419
420
421
422
423
				[self dealloc];
				@throw e;
			}

			@try {
				[obj retain];
			} @catch (OFException *e) {
				[self dealloc];
				[key release];

				@throw e;
			}

			data[j].key = key;
			data[j].object = obj;
			data[j].hash = hash;








<

>







408
409
410
411
412
413
414

415
416
417
418
419
420
421
422
423
				[self dealloc];
				@throw e;
			}

			@try {
				[obj retain];
			} @catch (OFException *e) {

				[key release];
				[self dealloc];
				@throw e;
			}

			data[j].key = key;
			data[j].object = obj;
			data[j].hash = hash;

435
436
437
438
439
440
441
442
443

444
445
446
447
448
449
450
			[self dealloc];
			@throw e;
		}

		@try {
			[data[j].object release];
		} @catch (OFException *e) {
			[self dealloc];
			[obj release];

			@throw e;
		}

		data[j].object = obj;
	}

	return self;







<

>







435
436
437
438
439
440
441

442
443
444
445
446
447
448
449
450
			[self dealloc];
			@throw e;
		}

		@try {
			[data[j].object release];
		} @catch (OFException *e) {

			[obj release];
			[self dealloc];
			@throw e;
		}

		data[j].object = obj;
	}

	return self;