[Bug 158721] klauncher crash close XCloseDisplay

Robert Gogolok gogolok at gmail.com
Mon Mar 3 16:49:42 GMT 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=158721         




------- Additional Comments From gogolok gmail com  2008-03-03 17:49 -------
There is the following commit for klauncher on kde 3.5:
http://websvn.kde.org/branches/KDE/3.5/kdelibs/kinit/klauncher.cpp?view=diff&r1=248080&r2=248081

I applied the same logic ("if defined Q_WS_X11 && ! defined K_WS_QTONLY") on klauncher in 4.0.1:

--- klauncher.cpp.old   2008-03-03 17:46:20.000000000 +0100
+++ klauncher.cpp       2008-03-03 17:39:56.000000000 +0100
 @ -50,7 +50,7  @
 #include <kio/connection.h>
 #include <kio/slaveinterface.h>
 
-#ifdef Q_WS_X11
+#if defined Q_WS_X11 && ! defined K_WS_QTONLY
 #include <kstartupinfo.h>
 #include <X11/Xlib.h>
 #endif
 @ -229,7 +229,7  @
 
 void KLauncher::close()
 {
-#ifdef Q_WS_X11
+#if define Q_WS_X11 && ! defined K_WS_QTONLY
    if( mCached_dpy != NULL )
        XCloseDisplay( mCached_dpy );
 #endif
 @ -492,7 +492,7  @
          requestResult.error += ":\n" + request->errorMsg;
       requestResult.pid = 0;
 
-#ifdef Q_WS_X11
+#if defined Q_WS_X11 && ! defined K_WS_QTONLY
       if (!request->startup_dpy.isEmpty())
       {
          Display* dpy = NULL;
 @ -783,7 +783,7  @
 KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr service, const QString& startup_id,
     const QStringList &envs )
 {
-#ifdef Q_WS_X11
+#if defined Q_WS_X11 && ! defined K_WS_QTONLY
     request->startup_id = "0";
     if( startup_id == "0" )
         return;
 @ -836,7 +836,7  @
 KLauncher::cancel_service_startup_info( KLaunchRequest* request, const QString& startup_id,
     const QStringList &envs )
 {
-#ifdef Q_WS_X11
+#if defined Q_WS_X11 && ! defined K_WS_QTONLY
     if( request != NULL )
         request->startup_id = "0";
     if( !startup_id.isEmpty() && startup_id != "0" )



klauncher doesn't crash anymore (since XCloseDisplay is not being called).



More information about the Unassigned-bugs mailing list