首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Linphone linphone_core_iterate崩溃

Linphone linphone_core_iterate崩溃
EN

Stack Overflow用户
提问于 2018-12-14 00:56:56
回答 1查看 366关注 0票数 1

我使用的是Linphone库,在销毁核心(linphone_core_unref)之后,我在linphone_core_iterate while循环上遇到了崩溃。以下是我的代码

代码语言:javascript
复制
func prepareToShutdown() {
    iterateTimer = nil
    iterateTimer?.invalidate()

    shutdown()
}

func shutdown(){
    NSLog("Shutdown..")

    let proxy_cfg = linphone_core_get_default_proxy_config(lc); /* get default proxy config*/
    linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/
    linphone_proxy_config_enable_register(proxy_cfg, 0); /*de-activate registration for this proxy config*/
    linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/

    linphone_core_unref(lc);
}

@objc func iterate(){
    if let lc = lc {
        print("iterating")
        linphone_core_iterate(lc); /* first iterate initiates registration */
    }
}

func setTimer(){
    iterateTimer = Timer.scheduledTimer(
        timeInterval: 1.0, target: self, selector: #selector(iterate), userInfo: nil, repeats: true)
}

这是崩溃截图

任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2019-05-22 13:39:30

对于这个问题,我有一个解决方案。我使用的是Intel NUC (甚至是不同的版本),它总是在使用System.AccessViolationException的时候崩溃。

对于Windows,解决方案是由于CPU过载而改变Thread.Sleep(20)睡眠时间,这会导致死锁。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53766677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档