summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-17 06:54:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-17 06:54:35 +0000
commite02b61406170e347f2cd4e5f56d101310bc746a6 (patch)
treefa3cbc00fd86c5622d96dd8031003acfea12ff70 /kdm
parentda658e720570ba6f38b7607831c80fc9364b2787 (diff)
downloadtdebase-e02b61406170e347f2cd4e5f56d101310bc746a6.tar.gz
tdebase-e02b61406170e347f2cd4e5f56d101310bc746a6.zip
Fix kdm crash on remote->local login switch
Detach from tsak process as early as possible git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1254061 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm')
-rw-r--r--kdm/kfrontend/kgapp.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp
index 1f2cd64da..f610ea776 100644
--- a/kdm/kfrontend/kgapp.cpp
+++ b/kdm/kfrontend/kgapp.cpp
@@ -185,13 +185,22 @@ kg_main( const char *argv0 )
KApplication::disableAutoDcopRegistration();
KCrash::setSafer( true );
- trinity_desktop_lock_use_sak = _useSAK;
KProcess *tsak = 0;
+ KProcess *proc = 0;
+ KProcess *comp = 0;
+ KProcess *kwin = 0;
+
+ trinity_desktop_lock_use_sak = _useSAK;
if (trinity_desktop_lock_use_sak) {
tsak = new KProcess;
*tsak << TQCString( argv0, strrchr( argv0, '/' ) - argv0 + 2 ) + "tsak";
tsak->start();
}
+ if (tsak) {
+ tsak->closeStdin();
+ tsak->detach();
+ delete tsak;
+ }
#ifdef HAVE_XCOMPOSITE
// Begin ARGB initialization
@@ -279,9 +288,6 @@ kg_main( const char *argv0 )
setup_modifiers( dpy, _numLockStatus );
SecureDisplay( dpy );
- KProcess *proc = 0;
- KProcess *comp = 0;
- KProcess *kwin = 0;
if (!_grabServer) {
if (_useBackground) {
proc = new KProcess;
@@ -334,7 +340,7 @@ kg_main( const char *argv0 )
KProcess *proc2 = 0;
app->setOverrideCursor( Qt::WaitCursor );
- FDialog *dialog;
+ FDialog *dialog = NULL;
#ifdef XDMCP
if (cmd == G_Choose) {
dialog = new ChooserDlg;
@@ -389,7 +395,9 @@ kg_main( const char *argv0 )
login_user = static_cast<KGreeter*>(dialog)->curUser;
- delete dialog;
+ if (rslt != ex_greet) {
+ delete dialog;
+ }
delete proc2;
#ifdef XDMCP
switch (rslt) {
@@ -432,11 +440,6 @@ kg_main( const char *argv0 )
kwin->detach();
delete kwin;
}
- if (tsak) {
- tsak->closeStdin();
- tsak->detach();
- delete tsak;
- }
delete proc;
UnsecureDisplay( dpy );
restore_modifiers();