ObjFW  Diff

Differences From Artifact [7907901ed0]:

To Artifact [8cd38ab1ca]:

  • File src/exceptions/OFListenFailedException.m — part of check-in [e1e7ffa903] at 2011-09-22 23:25:42 on branch trunk — Exceptions are now autoreleased.

    This is safe as an "exception loop" can't happen, since if allocating
    an exception fails, it throws an OFAllocFailedException which is
    preallocated and can always be thrown.

    So, the worst case would be that an autorelease of an exception fails,
    triggering an OFOutOfMemoryException for which there is no memory,
    resulting in an OFAllocFailedException to be thrown. (user: js, size: 1773) [annotate] [blame] [check-ins using]


21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFListenFailedException
+ newWithClass: (Class)class_
	socket: (OFTCPSocket*)socket
       backLog: (int)backlog
{
	return [[self alloc] initWithClass: class_
				    socket: socket
				   backLog: backlog];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException newWithClass: c
					      selector: _cmd];
}

- initWithClass: (Class)class_
	 socket: (OFTCPSocket*)socket_
	backLog: (int)backlog
{
	self = [super initWithClass: class_];







|
|
|

|
|
|






|
|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFListenFailedException
+ exceptionWithClass: (Class)class_
	      socket: (OFTCPSocket*)socket
	     backLog: (int)backlog
{
	return [[[self alloc] initWithClass: class_
				     socket: socket
				    backLog: backlog] autorelease];
}

- initWithClass: (Class)class_
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithClass: (Class)class_
	 socket: (OFTCPSocket*)socket_
	backLog: (int)backlog
{
	self = [super initWithClass: class_];