From 53db9ff1aa00425cc295b66438a6d6500ce5230e Mon Sep 17 00:00:00 2001 From: zinface Date: Tue, 19 Dec 2023 22:15:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=9C=A8=20linux=20/=20unix=20?= =?UTF-8?q?=E4=B8=AD=E7=A8=8B=E5=BA=8F=E5=BC=82=E5=B8=B8=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=85=B1=E4=BA=AB=E5=86=85=E5=AD=98=E4=B8=8D=E4=BC=9A=E5=9B=9E?= =?UTF-8?q?=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参考: https://gitee.com/zinface/infomation-tips/blob/master/src/main.cpp --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index cd6934a..a7c04c4 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -220,6 +220,11 @@ 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())//共享内存被占用则直接返回 { From 8ffd882d6e8b2fed666b5dafa80079bd07ded8bf Mon Sep 17 00:00:00 2001 From: zinface Date: Tue, 19 Dec 2023 22:23:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix-linux-shared:=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=B4=A9=E6=BA=83=E5=9C=BA=E6=99=AF=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a7c04c4..163d68e 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -220,8 +220,9 @@ if ((arguments.size() == 4) && (arguments[2] == QString("-n"))) } #endif - // 在 linux / unix 中程序异常结束共享内存不会回收 - // 参考 https://gitee.com/zinface/infomation-tips/blob/master/src/main.cpp + // 此部分一般由插件异常导致程序崩溃引发 + // 在 linux / unix 中程序异常结束共享内存不会回收 + // 参考 https://gitee.com/zinface/infomation-tips/blob/master/src/main.cpp shared.attach(); shared.detach();