[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok] /
From:       Mark Kretschmann <kretschmann () kde ! org>
Date:       2011-01-23 11:48:40
Message-ID: 20110123114840.DA32EA6092 () git ! kde ! org
[Download RAW message or body]

Git commit 0a640155c93868d7e6e6518f7879c68979506e21 by Mark Kretschmann
Pushed by markey into branch master

Prevent crash on exit when using Phonon-VLC.

Thanks to Harald Sitter (apachelogger) for solving this riddle. VLC
requires that XInitThreads() is called, so we are doing that now, but
only on X11 systems (if my CMake foo is correct). Please test.

M  +1    -0    ChangeLog     
M  +6    -1    src/CMakeLists.txt     
M  +11   -0    src/main.cpp     

http://commits.kde.org/amarok/0a640155c93868d7e6e6518f7879c68979506e21

diff --git a/ChangeLog b/ChangeLog
index 5f385b0..44a78a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@ VERSION 2.4.1
       <bhargav.1191@gmail.com>. (BR 248690)
 
   BUGFIXES:
+    * Prevent crash on exit when using Phonon-VLC.
     * Fixed crash in the queue editor when trying to show already
       removed items of the playlist. (BR 263308)
     * Fixed Mute button. (BR 253098)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1fdf599..2f1152f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -962,6 +962,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
${KDE4_ENABLE_EXCEPTIONS}")  
 kde4_add_app_icon(amarok_SRCS \
${CMAKE_CURRENT_SOURCE_DIR}/images/hi*-app-amarok.png)  
+INCLUDE(FindX11)
+
 if(Q_WS_MAC)
     kde4_add_executable(Amarok ${amarok_SRCS})
     target_link_libraries(Amarok ${KDE4_KDECORE_LIBS} amarokcore amaroklib \
) @@ -972,10 +974,13 @@ if(Q_WS_MAC)
     #the following line was copied from KDE4Macros.cmake. \
                kde4_add_app_icon fails to actually copy the .icns file
     SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/amarok.icns \
PROPERTIES MACOSX_PACKAGE_LOCATION Resources)  install(TARGETS Amarok \
${INSTALL_TARGETS_DEFAULT_ARGS}) +elseif(X11_FOUND)
+    kde4_add_executable(amarok ${amarok_SRCS})
+    target_link_libraries(amarok ${KDE4_KDEUI_LIBS} amarokcore amaroklib \
${X11_LIBRARIES} ${TAGLIB_LIBRARIES} ${TAGLIB-EXTRAS_LIBRARIES} ) +    \
install(TARGETS amarok ${INSTALL_TARGETS_DEFAULT_ARGS})  else(Q_WS_MAC)
     kde4_add_executable(amarok ${amarok_SRCS})
     target_link_libraries(amarok ${KDE4_KDEUI_LIBS} amarokcore amaroklib \
                ${TAGLIB_LIBRARIES} ${TAGLIB-EXTRAS_LIBRARIES} )
-
     install(TARGETS amarok ${INSTALL_TARGETS_DEFAULT_ARGS})
 endif(Q_WS_MAC)
 
diff --git a/src/main.cpp b/src/main.cpp
index c2c37a2..b4a24be 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,6 +23,12 @@
 #include <KCmdLineArgs>
 #include <KDebug>
 
+#include <qglobal.h>
+
+#ifdef Q_WS_X11
+    #include <X11/Xlib.h>
+#endif
+
 #include <csignal>
 
 //#define AMAROK_USE_DRKONQI
@@ -266,6 +272,11 @@ int main( int argc, char *argv[] )
     signal( SIGINT, &QCoreApplication::exit );
     signal( SIGTERM, &QCoreApplication::exit );
 
+    // This call is needed to prevent a crash on exit with Phonon-VLC and \
LibPulse +#ifdef Q_WS_X11
+    XInitThreads();
+#endif
+
     App app;
     app.setUniqueInstance( startFlag == \
KUniqueApplication::NonUniqueInstance );  return app.exec();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic