Skip to content

Commit

Permalink
Fix: UITests - error getting main window kAXErrorAPIDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhvorost committed Jan 4, 2024
1 parent 5c99c89 commit 5dc62c2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Sources/RegisterModules/RegisterModules.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ static void registerModules(void) {

for (int i = 0; i < numClasses; i++) {
Class class = classes[i];
@try {
Method method = class_getClassMethod(class, selector);
if (method != NULL) {

int numMethods = 0;
Method *methods = class_copyMethodList(object_getClass(class), &numMethods);
for (int j = 0; j < numMethods; j++) {
Method method = methods[j];
if (sel_isEqual(method_getName(method), selector)) {
IMP imp = method_getImplementation(method);
((id (*)(Class, SEL))imp)(class, selector);
((void (*)(Class, SEL))imp)(class, selector);
continue;
}
}
@catch(id exception) {
}
free(methods);
}
free(classes);
}

0 comments on commit 5dc62c2

Please sign in to comment.