author | zecke <zecke> | 2003-09-03 18:58:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-09-03 18:58:20 (UTC) |
commit | 3038503f6ffc2d58b00650d5feae23cc8e842bcb (patch) (side-by-side diff) | |
tree | 33b2b319307b9a5abda47b51c31329131295d703 /core/launcher/serverapp.cpp | |
parent | 577cdc4f2ce81eaceb132af08d8ab6fe12b4eadc (diff) | |
download | opie-3038503f6ffc2d58b00650d5feae23cc8e842bcb.zip opie-3038503f6ffc2d58b00650d5feae23cc8e842bcb.tar.gz opie-3038503f6ffc2d58b00650d5feae23cc8e842bcb.tar.bz2 |
Failure free restart of the launcher and a comment
why we do that
-rw-r--r-- | core/launcher/serverapp.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index 522ef07..28316a4 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp @@ -723,9 +723,28 @@ void ServerApplication::shutdown( ShutdownImpl::Type t ) void ServerApplication::restart() { if ( allowRestart ) { + + /* + * Applets and restart is a problem. Some applets delete + * their widgets even if ownership gets transfered to the + * parent (Systray ) but deleting the applet may be unsafe + * as well ( double deletion ). Some have topLevel widgets + * and when we dlclose and then delete the widget we will + * crash and an crash during restart is not nice + */ +#ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED + /* same as above */ + emit aboutToQuit(); prepareForTermination(TRUE); doRestart = TRUE; quit(); +#else + prepareForTermination( true ); + for ( int fd = 3; fd < 100; fd++ ) + close( fd ); + execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); + exit( 1 ); +#endif } } |