ASIHTTPRequest 在执行调用中崩溃

发布于 2024-12-06 08:50:43 字数 1099 浏览 2 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫九 2024-12-13 08:50:43

您的 downloadProgressDelegate 已被释放,无需先将其从 ASIHTTPRequest 的 downloadProgressDelegate 中删除。

在下载进度委托的 dealloc 实现中,调用:

[request setDownloadProgressDelegate:nil];

Your downloadProgressDelegate has been freed, without removing it from ASIHTTPRequest's downloadProgressDelegate first.

In the dealloc implementation for your download progress delegate, call:

[request setDownloadProgressDelegate:nil];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文