lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>         module = NSLinkModule(image, path,
>                               NSLINKMODULE_OPTION_PRIVATE |
>                               NSLINKMODULE_OPTION_RETURN_ON_ERROR);
>+
>+        NSDestroyObjectFileImage(image);
> 
>         if (module == NULL)
>         {
>                 NSLinkEditErrors dylderr;
>                 int dylderrno;
>                 const char *dyldfile;
>                 const char *errstr;
>                 NSLinkEditError(&dylderr, &dylderrno, &dyldfile, &errstr);
> 
>                 lua_pushnil(L);
>                 lua_pushstring(L,errstr);
>                 lua_pushstring(L,"init");
>                 return 3;
>         }
>-
>-        NSDestroyObjectFileImage(image);
> 
>         lua_pushfstring(L, "_%s", init);
>         symname = lua_tostring(L, -1);
>         sym = NSLookupSymbolInModule(module, symname);
>         if (sym == NULL)
>         {
>                 lua_pushnil(L);
>-                lua_pushstring(L,symname);
>+                lua_pushvalue(L,-2);
>                 lua_pushstring(L,"init");
>-                lua_remove(L, -4);
>                 return 3;
>         }
> 
>-        lua_pop(L, 1);
>         lua_pushlightuserdata(L, module);
>         lua_pushcclosure(L, NSAddressOfSymbol(sym), 1);
>         return 1;
> }
> #endif /* USE_DYLD */