Authored by 朱小军

Merge branch 'yohobuy_dev' into 'master'

修改收到信号量错误时 直接杀掉APP

review by 枪兵

See merge request !39
... ... @@ -9,7 +9,7 @@
Pod::Spec.new do |s|
s.name = "YHEventReport"
s.version = "1.3.1"
s.version = "1.3.5"
s.summary = "YHEventReport."
s.description = "无埋点SDK"
s.homepage = "http://git.yoho.cn/mobile/YH_EventReport"
... ...
... ... @@ -55,7 +55,7 @@ void yh_sighandler(int signal)
YOHOAppReportKeyJsonKeyPageChain : pageChains,
kYHEventReportTimeElapsed : currentTimestamp()?:@""
};
[crash performSelectorOnMainThread:@selector(handleCrashInfo:) withObject:userInfo waitUntilDone:YES];
[crash performSelectorOnMainThread:@selector(handleSigCrashInfo:) withObject:userInfo waitUntilDone:YES];
}
void yh_uncaughtCrashExceptionHandler(NSException *exception)
... ... @@ -130,6 +130,26 @@ void yh_uncaughtCrashExceptionHandler(NSException *exception)
return callStackString;
}
- (void)handleSigCrashInfo:(NSDictionary*)userInfo
{
[self handleCrashInfo:userInfo];
[self killApp];
}
- (void)killApp
{
NSSetUncaughtExceptionHandler(NULL);
signal(SIGABRT, SIG_DFL);
signal(SIGILL, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGBUS, SIG_DFL);
signal(SIGPIPE, SIG_DFL);
kill(getpid(), SIGKILL);
}
- (void)handleCrashInfo:(NSDictionary*)userInfo
{
YHLog(@"crash============:\n%@", userInfo);
... ...