2017-03-09 65 views
0

我一直注意到在我的应用程序中随机崩溃似乎都与SignalR-ObjC有关。在收到SignalR数据后或接收数据几分钟后,可能会发生崩溃。SignalR/malloc错误 - 释放对象的校验和不正确?

的错误信息是:

malloc: *** error for object 0x7fbae292ce00: incorrect checksum for freed object - object was probably modified after being freed. 
*** set a breakpoint in malloc_error_break to debug 

断点被放置在这条线在SRChunkBuffer.m文件:

[_buffer appendString:[[NSString alloc] initWithData:buffer encoding:NSUTF8StringEncoding]]; 

如果我注释掉我的代码使用SignalR-ObjC调用服务器端的方法来订阅组,这种崩溃不会发生:

for (NSString *groupName in combinedArray){ 
    [proxy invoke:@"Subscribe" withArgs:@[groupName] completionHandler:nil]; 
    } 

我做了确保SignalR-ObjC的所有可可豆荚/依赖项都是最新的,删除了我的循环以注册组,并且一次一个地为它们手动注册,但我仍然随机得到一个崩溃。

我看到提及可能使用@synchronized但不知道如何适合这种情况。

我该如何阻止这次事故?

回答

相关问题