author | zecke <zecke> | 2003-09-03 18:58:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-09-03 18:58:20 (UTC) |
commit | 3038503f6ffc2d58b00650d5feae23cc8e842bcb (patch) (unidiff) | |
tree | 33b2b319307b9a5abda47b51c31329131295d703 /core/launcher | |
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 | ||||
-rw-r--r-- | core/launcher/systray.cpp | 8 | ||||
-rw-r--r-- | core/launcher/systray.h | 1 |
3 files changed, 28 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 | |||
@@ -724,7 +724,26 @@ void ServerApplication::restart() | |||
724 | { | 724 | { |
725 | if ( allowRestart ) { | 725 | if ( allowRestart ) { |
726 | |||
727 | /* | ||
728 | * Applets and restart is a problem. Some applets delete | ||
729 | * their widgets even if ownership gets transfered to the | ||
730 | * parent (Systray ) but deleting the applet may be unsafe | ||
731 | * as well ( double deletion ). Some have topLevel widgets | ||
732 | * and when we dlclose and then delete the widget we will | ||
733 | * crash and an crash during restart is not nice | ||
734 | */ | ||
735 | #ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED | ||
736 | /* same as above */ | ||
737 | emit aboutToQuit(); | ||
726 | prepareForTermination(TRUE); | 738 | prepareForTermination(TRUE); |
727 | doRestart = TRUE; | 739 | doRestart = TRUE; |
728 | quit(); | 740 | quit(); |
741 | #else | ||
742 | prepareForTermination( true ); | ||
743 | for ( int fd = 3; fd < 100; fd++ ) | ||
744 | close( fd ); | ||
745 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); | ||
746 | exit( 1 ); | ||
747 | #endif | ||
729 | } | 748 | } |
730 | } | 749 | } |
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 64356ca..6122770 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -70,4 +70,12 @@ void SysTray::clearApplets() | |||
70 | #ifndef QT_NO_COMPONENTS | 70 | #ifndef QT_NO_COMPONENTS |
71 | 71 | ||
72 | /* | ||
73 | * Note on clearing. SOme applets delete their | ||
74 | * applets themselves some don't do it | ||
75 | * and on restart this can crash. If we delete it | ||
76 | * here we might end up in a double deletion. We could | ||
77 | * use QGuardedPtr but that would be one QOBject | ||
78 | * for every applet more but only useful for restart | ||
79 | */ | ||
72 | QValueList<TaskbarApplet>::Iterator mit; | 80 | QValueList<TaskbarApplet>::Iterator mit; |
73 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { | 81 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { |
diff --git a/core/launcher/systray.h b/core/launcher/systray.h index 77c581f..b989d58 100644 --- a/core/launcher/systray.h +++ b/core/launcher/systray.h | |||
@@ -28,4 +28,5 @@ | |||
28 | #include <qframe.h> | 28 | #include <qframe.h> |
29 | #include <qvaluelist.h> | 29 | #include <qvaluelist.h> |
30 | #include <qguardedptr.h> | ||
30 | 31 | ||
31 | class QHBoxLayout; | 32 | class QHBoxLayout; |