Pre Merge pull request !95 from 麻本法/fix-linux-shared-memory

This commit is contained in:
麻本法 2024-05-09 04:26:34 +00:00 committed by Gitee
commit 62ff30cecf
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 6 additions and 0 deletions

View File

@ -220,6 +220,12 @@ if ((arguments.size() == 4) && (arguments[2] == QString("-n")))
}
#endif
// 此部分一般由插件异常导致程序崩溃引发
// 在 linux / unix 中程序异常结束共享内存不会回收
// 参考 https://gitee.com/zinface/infomation-tips/blob/master/src/main.cpp
shared.attach();
shared.detach();
//attach成功表示已经存在该内存了表示当前存在实例
if (shared.attach())//共享内存被占用则直接返回
{