ObjFW  Check-in [d2886a005f]

Overview
Comment:bridge: Fix missing deallocs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d2886a005f33a9c99fbf8bdb2ed09d0348e2057f981139bb83346a0cb1a117e7
User & Date: js on 2019-06-18 01:42:33
Other Links: manifest | tags
Context
2019-06-18
01:54
bridge: Add bridging for {OF,NS}Enumerator check-in: 7080ad2ebf user: js tags: trunk
01:42
bridge: Fix missing deallocs check-in: d2886a005f user: js tags: trunk
00:06
Fix typo to fix Win32 check-in: c15164ca65 user: js tags: trunk
Changes

Modified src/bridge/NSOFArray.m from [119e446fe6] to [0a8a4eafff].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36







37
38
39
40
41
42
43
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSOFArray
- (instancetype)initWithOFArray: (OFArray *)array
{
	if ((self = [super init]) != nil) {
		@try {
			_array = [array retain];
		} @catch (id e) {
			return nil;
		}
	}

	return self;
}








- (id)objectAtIndex: (NSUInteger)idx
{
	id object = [_array objectAtIndex: idx];

	if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];







|
<
|
<
<
<
<



>
>
>
>
>
>
>







20
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
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSOFArray
- (instancetype)initWithOFArray: (OFArray *)array
{
	if ((self = [super init]) != nil)

		_array = [array retain];





	return self;
}

- (void)dealloc
{
	[_array release];

	[super dealloc];
}

- (id)objectAtIndex: (NSUInteger)idx
{
	id object = [_array objectAtIndex: idx];

	if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)])
		return [object NSObject];

Modified src/bridge/NSOFDictionary.m from [671d75450d] to [08a371f09a].

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38







39
40
41
42
43
44
45
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSOFDictionary
- (instancetype)initWithOFDictionary: (OFDictionary *)dictionary
{
	if ((self = [super init]) != nil) {
		@try {
			_dictionary = [dictionary retain];
		} @catch (id e) {
			return nil;
		}
	}

	return self;
}








- (id)objectForKey: (id)key
{
	id object;

	if ([(NSObject *)key conformsToProtocol: @protocol(NSBridging)])
		key = [key OFObject];







|
<
|
<
<
<
<



>
>
>
>
>
>
>







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
#import "OFBridging.h"

#import "OFOutOfRangeException.h"

@implementation NSOFDictionary
- (instancetype)initWithOFDictionary: (OFDictionary *)dictionary
{
	if ((self = [super init]) != nil)

		_dictionary = [dictionary retain];





	return self;
}

- (void)dealloc
{
	[_dictionary release];

	[super dealloc];
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(NSObject *)key conformsToProtocol: @protocol(NSBridging)])
		key = [key OFObject];

Modified src/bridge/OFNSArray.m from [79fd147030] to [265432c593].

37
38
39
40
41
42
43







44
45
46
47
48
49
50
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}








- (id)objectAtIndex: (size_t)idx
{
	id object;

	if (idx > NSUIntegerMax)
		@throw [OFOutOfRangeException exception];







>
>
>
>
>
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_array release];

	[super dealloc];
}

- (id)objectAtIndex: (size_t)idx
{
	id object;

	if (idx > NSUIntegerMax)
		@throw [OFOutOfRangeException exception];

Modified src/bridge/OFNSDictionary.m from [233690560e] to [3e5d86d339].

38
39
40
41
42
43
44







45
46
47
48
49
50
51
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}








- (id)objectForKey: (id)key
{
	id object;

	if ([(OFObject *)key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];







>
>
>
>
>
>
>







38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_dictionary release];

	[super dealloc];
}

- (id)objectForKey: (id)key
{
	id object;

	if ([(OFObject *)key conformsToProtocol: @protocol(OFBridging)])
		key = [key NSObject];