[Qt-interest] A couple of Issues in Qt Application
Raja Rokkam
rokkamraja at gmail.com
Fri Oct 30 02:27:14 CET 2009
Thank you, All for the help.
On Fri, Oct 30, 2009 at 3:33 AM, jjDaNiMoTh <jjdanimoth at gmail.com> wrote:
> 2009/10/29 Raja Rokkam <rokkamraja at gmail.com>:
> > Hi All,
> >
> > 1.) I am trying to implement QSharedMemory to prevent running multiple
> > instance of my application. The code works fine in WIndows but in Unix it
> > works fine as long as there is no crash. If there is a crash the
> > QSharedMemory survives the crash and so later no instance is spawned
> until
> > PC is rebooted.
> > Is there any solution for this issue or any other simpler and cleaner
> > solution ?
>
> I think there's no solution for the issue; it's the UNIX design.
>
> If we look at the standard POSIX, if you open a segment of shared
> memory (shm_open), you need explicity to unlink it (shm_unlink),
> otherwise it will live until reboot ( and, if you think about it, it
> makes sense ).
>
> So, if your code works fine, try to don't have crashes.
>
> If it crashes, use ipcs (on linux/os x) and see if you can force a delete.
>
> HTH
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091030/263a3b15/attachment.html
More information about the Qt-interest-old
mailing list