ObjFW  Check-in [e5efcb03ac]

Overview
Comment:Better error handling for OFAutoreleasePools.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e5efcb03acd3e9a7655cd12e0f4a36945c96985c4a52b6c8e322f336df65d26d
User & Date: js on 2009-05-19 10:33:30
Other Links: manifest | tags
Context
2009-05-19
16:15
One more convenience method for OFDictionary. check-in: 5413ba3c49 user: js tags: trunk
10:33
Better error handling for OFAutoreleasePools. check-in: e5efcb03ac user: js tags: trunk
2009-05-18
23:14
Rename doxygen.cfg -> Doxyfile. check-in: e698bc8329 user: js tags: trunk
Changes

Modified src/OFAutoreleasePool.m from [81f708f0c4] to [4359bf55c9].

42
43
44
45
46
47
48

49
50



51
52

53

54
55


56




57
58
59
60
61
62
63
64
65

66







67
68




69
70
71


72




73
74
75
76
77
78
79
}

+ (void)addToPool: (OFObject*)obj
{
	OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];

	if (pool_list == nil || [pool_list last] == NULL) {

		[[self alloc] init];
		pool_list = [OFThread objectForTLSKey: pool_list_key];



	}


	if (pool_list == nil || [pool_list last] == NULL)

		@throw [OFInitializationFailedException newWithClass: self];



	[[pool_list last]->object addToPool: obj];




}

- init
{
	OFList *pool_list;

	self = [super init];

	if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) {

		pool_list = [[OFList alloc] initWithoutRetainAndRelease];







		[OFThread setObject: pool_list
			  forTLSKey: pool_list_key];




		[pool_list release];
	}



	listobj = [pool_list append: self];





	return self;
}

- (void)dealloc
{
	/*







>
|
|
>
>
>
|
|
>
|
>

|
>
>
|
>
>
>
>









>
|
>
>
>
>
>
>
>
|
|
>
>
>
>
|
|
|
>
>
|
>
>
>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
}

+ (void)addToPool: (OFObject*)obj
{
	OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];

	if (pool_list == nil || [pool_list last] == NULL) {
		@try {
			[[self alloc] init];
			pool_list = [OFThread objectForTLSKey: pool_list_key];
		} @catch (OFException *e) {
			[obj release];
			@throw e;
		}
	}

	if (pool_list == nil || [pool_list last] == NULL) {
		[obj release];
		@throw [OFInitializationFailedException newWithClass: self];
	}

	@try {
		[[pool_list last]->object addToPool: obj];
	} @catch (OFException *e) {
		[obj release];
		@throw e;
	}
}

- init
{
	OFList *pool_list;

	self = [super init];

	if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) {
		@try {
			pool_list = [[OFList alloc]
			    initWithoutRetainAndRelease];
		} @catch (OFException *e) {
			[self dealloc];
			@throw e;
		}

		@try {
			[OFThread setObject: pool_list
				  forTLSKey: pool_list_key];
		} @catch (OFException *e) {
			[self dealloc];
			@throw e;
		} @finally {
			[pool_list release];
		}
	}

	@try {
		listobj = [pool_list append: self];
	} @catch (OFException *e) {
		[self dealloc];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	/*