Skip to content

在线程内使用Bot相关代码闪退 #11

@HelloMitsuha

Description

@HelloMitsuha

Describe the bug
未知原因,在thread使用Bot相关代码会导致整个软件层的闪退
包括但不限于
①直接使用Bot(QQ号)
②变量赋值Bot对象并调用

To Reproduce
①编写对应代码(thread代码套Bot代码)

thread(function()--线程
  --原本有while,后来用了sleep也不好使
  --因此删除了while true do,但不影响闪退
  g=Bot(qq):getGroup(群号)
end)

②导入脚本并(在有Bot在线时)执行
③恭喜,闪退了

Expected behavior
没有症状,直接闪退,且没有错误日志

Screenshots
由于前面是线程执行loadstring/loadfile内包含Bot指令(脚本前面给mybot赋值了自动获取的Bot对象,因此此截图仍然适用)
Screenshot_20220823_121510(注:前面有调用过变量执行Bot命令,读取文件执行会闪退,而图片问题虽不与更改后的Issues内容相关,但也可能是在线程中使用loadstring出现的部分代码无法执行的问题)
Screenshot_20220823_121344
Screenshot_20220823_121641
(注:没有执行os.exit)

Desktop (please complete the following information):

  • OS: 无
  • Browser 无
  • Version 无

Smartphone (please complete the following information):

  • Device: HUAWEI EMUI10
  • OS: Android 10
  • Browser: Via
  • Version 4.4.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions