5555struct MCLoadedExtension
5656{
5757 MCLoadedExtension *next;
58- MCStringRef filename ;
58+ MCNameRef module_name ;
5959 MCStringRef resource_path;
6060 MCScriptModuleRef module ;
6161 MCScriptInstanceRef instance;
@@ -125,7 +125,7 @@ bool MCEngineAddExtensionFromModule(MCStringRef p_filename, MCScriptModuleRef p_
125125 MCLoadedExtension *t_ext;
126126 /* UNCHECKED */ MCMemoryNew (t_ext);
127127
128- t_ext -> filename = MCValueRetain (p_filename );
128+ t_ext -> module_name = MCValueRetain (MCScriptGetNameOfModule (p_module) );
129129 t_ext -> module = MCScriptRetainModule (p_module);
130130 t_ext -> instance = t_instance;
131131
@@ -178,10 +178,6 @@ void MCEngineExecLoadExtension(MCExecContext& ctxt, MCStringRef p_filename, MCSt
178178 if (!MCS_loadbinaryfile (*t_resolved_filename, &t_data))
179179 return ;
180180
181- for (MCLoadedExtension *t_ext = MCextensions; t_ext != nil; t_ext = t_ext -> next)
182- if (MCStringIsEqualTo (t_ext -> filename, *t_resolved_filename, kMCStringOptionCompareCaseless ))
183- return ;
184-
185181 MCStreamRef t_stream;
186182 /* UNCHECKED */ MCMemoryInputStreamCreate (MCDataGetBytePtr (*t_data), MCDataGetLength (*t_data), t_stream);
187183
@@ -205,22 +201,21 @@ void MCEngineExecLoadExtension(MCExecContext& ctxt, MCStringRef p_filename, MCSt
205201
206202 MCScriptReleaseModule (t_module);
207203
208-
209204 return ;
210205}
211206
212- void MCEngineExecUnloadExtension (MCExecContext& ctxt, MCStringRef p_filename )
207+ void MCEngineExecUnloadExtension (MCExecContext& ctxt, MCStringRef p_module_name )
213208{
214- MCAutoStringRef t_resolved_filename ;
215- /* UNCHECKED */ MCS_resolvepath (p_filename , &t_resolved_filename );
209+ MCNewAutoNameRef t_name ;
210+ MCNameCreate (p_module_name , &t_name );
216211
217212 for (MCLoadedExtension *t_previous = nil, *t_ext = MCextensions; t_ext != nil; t_previous = t_ext, t_ext = t_ext -> next)
218- if (MCStringIsEqualTo (t_ext -> filename , *t_resolved_filename, kMCStringOptionCompareCaseless ))
213+ if (MCNameIsEqualTo (t_ext -> module_name , *t_name ))
219214 {
220215 if (t_ext -> instance != nil)
221216 MCScriptReleaseInstance (t_ext -> instance);
222217 MCScriptReleaseModule (t_ext -> module );
223- MCValueRelease (t_ext -> filename );
218+ MCValueRelease (t_ext -> module_name );
224219 MCValueRelease (t_ext -> resource_path);
225220 if (t_previous != nil)
226221 t_previous -> next = t_ext -> next;
@@ -245,7 +240,7 @@ void MCEngineGetLoadedExtensions(MCExecContext& ctxt, MCProperListRef& r_list)
245240 t_success = MCProperListCreateMutable (t_list);
246241
247242 for (MCLoadedExtension *t_ext = MCextensions; t_success && t_ext != nil; t_ext = t_ext -> next)
248- t_success = MCProperListPushElementOntoBack (t_list, MCScriptGetNameOfModule ( t_ext -> module ) );
243+ t_success = MCProperListPushElementOntoBack (t_list, t_ext -> module_name );
249244
250245 if (t_success)
251246 t_success = MCProperListCopyAndRelease (t_list, r_list);
@@ -258,21 +253,6 @@ void MCEngineGetLoadedExtensions(MCExecContext& ctxt, MCProperListRef& r_list)
258253 }
259254}
260255
261- bool MCEngineIterateExtensionFilenames (uintptr_t & x_iterator, MCStringRef& r_filename)
262- {
263- if (x_iterator == 0 )
264- x_iterator = (uintptr_t )MCextensions;
265- else
266- x_iterator = (uintptr_t )(((MCLoadedExtension *)x_iterator) -> next);
267-
268- if (x_iterator == 0 )
269- return false ;
270-
271- r_filename = ((MCLoadedExtension *)x_iterator) -> filename;
272-
273- return true ;
274- }
275-
276256Exec_stat MCEngineHandleLibraryMessage (MCNameRef p_message, MCParameter *p_parameters)
277257{
278258 if (MCextensionschanged)
0 commit comments