···1616#include "common/selector.h"
1717#include "common/cfstring.h"
1818#include <map>
1919+#include <queue>
19202021// Superclass references in Mach-O don't use classref
2122// Neither do category class references
2223std::map<const void*,Class> g_classPointers;
2424+std::queue<Class> g_pendingInitClasses;
23252426// Here we process Mach-O files that have been loaded before this native library
2527// Then we register a handler to process all images loaded in the future
···7274 UpdateClassRefs(mh);
7375 UpdateSelectors(mh, slide);
7476 UpdateCFStrings(mh);
7777+7878+ static SEL selInit = sel_getUid("init");
7979+ while (!g_pendingInitClasses.empty())
8080+ {
8181+ id c = (id) g_pendingInitClasses.front();
8282+ IMP imp = objc_msg_lookup(c, selInit);
8383+ g_pendingInitClasses.pop();
8484+ imp(c, selInit);
8585+ }
7586}
76877788void ProcessImageUnload(const struct mach_header* mh, intptr_t)