ObjFW  Diff

Differences From Artifact [c0583ef178]:

To Artifact [7523e6d739]:


104
105
106
107
108
109
110












111
112
113
114
115
116


117
118
119
120
121
122
123
124
125
126
127

	return self;
}

- (void)dealloc
{
	[next dealloc];













	if (prev != nil)
		prev->next = nil;

	/* FIXME: Add exception? */
	of_tlskey_set(last_key, prev);


	if (of_tlskey_get(first_key) == self)
		of_tlskey_set(first_key, nil);

	[objects release];

	[super dealloc];
}

- addObject: (OFObject*)obj
{
	if (objects == nil)







>
>
>
>
>
>
>
>
>
>
>
>




|
|
>
>

|
|
<







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140

	return self;
}

- (void)dealloc
{
	[next dealloc];
	[objects release];

	/*
	 * If of_tlskey_set fails, this is a real problem. The best we can do
	 * is to not change the pool below the current pool and stop
	 * deallocation. This way, new objects will be added to the current
	 * pool, but released when the pool below gets released - and maybe
	 * the pool itself will be released as well then, because maybe
	 * of_tlskey_set will work this time.
	 */
	if (!of_tlskey_set(last_key, prev))
		return;

	if (prev != nil)
		prev->next = nil;

	/*
	 * If of_tlskey_set fails here, this is even worse, as this will
	 * definitely be a memory leak. But this should never happen anyway.
	 */
	if (of_tlskey_get(first_key) == self)
		if (!of_tlskey_set(first_key, nil))
			return;


	[super dealloc];
}

- addObject: (OFObject*)obj
{
	if (objects == nil)