我遇到这个错误"malloc:* auto malloc731: error:未注册线程上的GC操作。线程隐式注册。在调试时中断auto_zone_thread_registration_error()。“
我的应用程序是这样工作的,当用户双击NSTableView中的一行时,它会从该行获得一个网址,然后要求WebView从该网址加载页面:
[tableView setDoubleAction:@selector(doubleClickAction:)];
...
- (IBAction)doubleClickAction:(id)sender {
...
/* cause that malloc error */
[[webView mainFrame] loadRequest: [NSURLRequest requestWithURL: row.url]];
} 那么我该如何修复它呢?
谢谢!
发布于 2011-05-02 22:38:33
所以我得到了https://bugs.webkit.org/show_bug.cgi?id=59938的回复,“这是在r81825中修复的。这是一条无害的消息,可以忽略。”
发布于 2012-05-14 19:13:18
将此objc_registerThreadWithCollector();添加到您的pthread中。如果找不到符号或链接错误,请使用以下代码,
#include <dlfcn.h>
void (*registerThreadWithCollector_fn)(void);
registerThreadWithCollector_fn = (void(*)(void)) dlsym(RTLD_NEXT, "objc_registerThreadWithCollector");
if (registerThreadWithCollector_fn) {
(*registerThreadWithCollector_fn)();
} else {
// do something else
}https://stackoverflow.com/questions/5850141
复制相似问题