ASIHTTPRequest 在执行调用中崩溃
我在 ASIHTTPRequest 的执行调用:方法上遇到崩溃。
堆栈是:
ASIHTTPRequest performInvocation:onTarget:releasingObject: 1877
ASIHTTPRequest performSelector:onTarget:withObject:amount:callerToRetain: 1870
ASIHTTPRequest updateProgressIndicator:withProgress:ofTotal: 1903
ASINetworkQueue request:didReceiveBytes: 240
ASIHTTPRequest performInvocation:onTarget:releasingObject: 1877
这是发生崩溃的方法:
+ (void)performInvocation:(NSInvocation *)invocation onTarget:(id *)target releasingObject:(id)objectToRelease
{
if (*target && [*target respondsToSelector:[invocation selector]]) {
[invocation invokeWithTarget:*target];
}
CFRelease(invocation);
if (objectToRelease) {
CFRelease(objectToRelease);
}
}
我相信它发生在 invokeWithTarget 调用上。
这种情况很少发生,但在大规模部署中却经常发生。
四处搜索,我发现了一个模糊的参考添加
:
回到performSelector:... 就在 [cbInspiration PerformSelectorOnMainThread:...] 调用之前。但这似乎并不具有权威性,而且我不确定我是否了解那里发生的事情足以做出和/或信任这种改变。我无法在本地重现该问题,但我从现场获得了大量带有此堆栈跟踪的崩溃报告。
顺便说一句,这是在 iOS 代码上。
有人知道这可能是什么吗?
I'm getting a crash in ASIHTTPRequest on the performInvocation: method.
The stack is:
ASIHTTPRequest performInvocation:onTarget:releasingObject: 1877
ASIHTTPRequest performSelector:onTarget:withObject:amount:callerToRetain: 1870
ASIHTTPRequest updateProgressIndicator:withProgress:ofTotal: 1903
ASINetworkQueue request:didReceiveBytes: 240
ASIHTTPRequest performInvocation:onTarget:releasingObject: 1877
This is the method where the crash happens:
+ (void)performInvocation:(NSInvocation *)invocation onTarget:(id *)target releasingObject:(id)objectToRelease
{
if (*target && [*target respondsToSelector:[invocation selector]]) {
[invocation invokeWithTarget:*target];
}
CFRelease(invocation);
if (objectToRelease) {
CFRelease(objectToRelease);
}
}
I believe it to be happening on the invokeWithTarget call.
This happens rarely, but in a large-scale deployment it's happening a lot.
Searching around, I found a vague reference to adding:
[cbInvocation retainArguments];
back in performSelector:... right before the [cbInvocation performSelectorOnMainThread:...] call. But it hardly seemed authoritative, and I'm not certain I understan what's going on there enough to make and/or trust that sort of change. I cannot reproduce the problem locally, but I get a large number of crash reports with this stack trace from the field.
This on iOS code, by the way.
Anyone have an idea what this might be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 downloadProgressDelegate 已被释放,无需先将其从 ASIHTTPRequest 的 downloadProgressDelegate 中删除。
在下载进度委托的 dealloc 实现中,调用:
Your downloadProgressDelegate has been freed, without removing it from ASIHTTPRequest's downloadProgressDelegate first.
In the dealloc implementation for your download progress delegate, call: