[Qt-interest] qsharedmemory after crash.

David Forstenlechner dforsten at newtek.com
Fri Jul 29 12:31:25 CEST 2011


I am running into the same problem,
there does not seem to be a way to destroy memory allocated by
QSharedMemory after
an unclean shutdown of a process attached to it, making this nice cross
platform abstraction
dubious in production code, you have to descend to platform specific
APIs in any case.
Its good for quick prototyping though.

A "destroy()" function like in QtSharedMemory would be very helpful.

- DavidF

Am 05.09.2008 18:44, schrieb bkn at ithryn.net:
> Hi All,
> I have found qsharedmemory to be very useful. Sadly, i'm not a perfect
> programmer and my application will crash. This leaves memory segments
> created by qsharedmemory to live beyond the application crash. The next
> time i run the application it will attach to the previously allocated
> memory segment from before the crash. This behavior is described in the Qt
> Documentation. 
>
> Is there a way i can tell Qt (or linux) to release that memory segment so
> when i run my application after a crash it will attach to a clean and
> perhaps differently sized memory segment? Otherwise it seems i have to quit
> KDE or even restart the computer to start with fresh memory segments. I
> suppose one way to do this is to create a qsharedmemory instance with a
> unique name every time the application is run, but i was hoping there is a
> better way since i use several instances of qsharedmemory segments.
>
> Thanks for you help, cheers, 
>  - b
>
>
> --
> To unsubscribe - send a mail to qt-interest-request at trolltech.com with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>



More information about the Qt-interest-old mailing list