105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
initPlugin = (init_plugin_t)(uintptr_t)of_dlsym(handle, "init_plugin");
if (initPlugin == (init_plugin_t)0 || (plugin = initPlugin()) == nil) {
of_dlclose(handle);
@throw [OFInitializationFailedException
exceptionWithClass: self];
}
plugin->_handle = handle;
return plugin;
}
- (instancetype)init
{
if ([self isMemberOfClass: [OFPlugin class]]) {
@try {
|
|
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
initPlugin = (init_plugin_t)(uintptr_t)of_dlsym(handle, "init_plugin");
if (initPlugin == (init_plugin_t)0 || (plugin = initPlugin()) == nil) {
of_dlclose(handle);
@throw [OFInitializationFailedException
exceptionWithClass: self];
}
plugin->_pluginHandle = handle;
return plugin;
}
- (instancetype)init
{
if ([self isMemberOfClass: [OFPlugin class]]) {
@try {
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
}
return [super init];
}
- (void)dealloc
{
of_plugin_handle_t h = _handle;
[super dealloc];
of_dlclose(h);
}
@end
|
|
|
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
}
return [super init];
}
- (void)dealloc
{
of_plugin_handle_t h = _pluginHandle;
[super dealloc];
of_dlclose(h);
}
@end
|