Differences From Artifact [bfb6a3d936]:
- File src/OFPlugin.m — part of check-in [297dbbb2b1] at 2009-04-13 16:29:21 on branch trunk — OFPlugin: Properly close handle on error. (user: js, size: 1954) [annotate] [blame] [check-ins using]
To Artifact [ee4d5662a9]:
- File
src/OFPlugin.m
— part of check-in
[179174571e]
at
2009-04-19 17:06:46
on branch trunk
— Don't use forwarding for OFPlugin.
This is faster and we don't rely on forwarding which is broken in
both, the GNU and the Apple runtime. Eventually, there will be an
implementation for forwarding that does work around the runtime bugs,
but still, an implementation of OFPlugin without forwarding makes more
sense. (user: js, size: 1562) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
17 18 19 20 21 22 23 | #import "OFPlugin.h" #import "OFExceptions.h" @implementation OFPlugin + pluginFromFile: (const char*)path { | < < < < < > | > | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import "OFPlugin.h" #import "OFExceptions.h" @implementation OFPlugin + pluginFromFile: (const char*)path { char *file; size_t pathlen, suffixlen; void *handle; OFPlugin *(*init_plugin)(); OFPlugin *plugin; Class c; if ((self = [super init])) { pathlen = strlen(path); suffixlen = strlen(PLUGIN_SUFFIX); if ((file = malloc(pathlen + suffixlen + 1)) == NULL) { |
︙ | ︙ | |||
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | (plugin = init_plugin()) == nil) { dlclose(handle); c = [self class]; [super free]; @throw [OFInitializationFailedException newWithClass: c]; } } return self; } - free { | > > > < < < < < < < < < < < < < < < < < < < < < | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | (plugin = init_plugin()) == nil) { dlclose(handle); c = [self class]; [super free]; @throw [OFInitializationFailedException newWithClass: c]; } plugin->handle = handle; return plugin; } return self; } - free { dlclose(handle); return [super free]; } @end |