ObjFW  Check-in [297dbbb2b1]

Overview
Comment:OFPlugin: Properly close handle on error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 297dbbb2b14afc52fe5c3dd2ebb9bef873a811259102f723d8d7a12bb0e5fd2c
User & Date: js on 2009-04-13 16:29:21
Other Links: manifest | tags
Context
2009-04-15
20:31
Workaround for wrong length of OFConstStrings on PPC64 OS X.
Apple does a strange thing there: The length is only 32 bit, followed
by another 32 bit which seem to be garbage.
check-in: 9b3e9e6895 user: js tags: trunk
2009-04-13
16:29
OFPlugin: Properly close handle on error. check-in: 297dbbb2b1 user: js tags: trunk
2009-04-12
14:51
Get rid of the dependency on Object. check-in: cbdd534337 user: js tags: trunk
Changes

Modified src/OFPlugin.m from [496529e854] to [bfb6a3d936].

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58









59
60
61
62
63
64
65
						      andSize: pathlen +
							       suffixlen + 1];
		}
		memcpy(file, path, pathlen);
		memcpy(file + pathlen, PLUGIN_SUFFIX, suffixlen);
		file[pathlen + suffixlen] = 0;

		if ((handle = dlopen(file, RTLD_NOW)) == NULL ||
		    (init_plugin = dlsym(handle, "init_plugin")) == NULL ||
		    (plugin = init_plugin()) == nil) {
			free(file);
			c = [self class];
			[super free];
			@throw [OFInitializationFailedException
			    newWithClass: c];
		}
		free(file);









	}

	return self;
}

- free
{







|
<
<







>
>
>
>
>
>
>
>
>







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
						      andSize: pathlen +
							       suffixlen + 1];
		}
		memcpy(file, path, pathlen);
		memcpy(file + pathlen, PLUGIN_SUFFIX, suffixlen);
		file[pathlen + suffixlen] = 0;

		if ((handle = dlopen(file, RTLD_NOW)) == NULL) {


			free(file);
			c = [self class];
			[super free];
			@throw [OFInitializationFailedException
			    newWithClass: c];
		}
		free(file);

		if ((init_plugin = dlsym(handle, "init_plugin")) == NULL ||
		    (plugin = init_plugin()) == nil) {
			dlclose(handle);
			c = [self class];
			[super free];
			@throw [OFInitializationFailedException
			    newWithClass: c];
		}
	}

	return self;
}

- free
{