Move to thread causes issue <p>I recently as the following question where I had issue with the object in the thread not getting deleted before the thred was killed:</p> <p><a href="http://stackoverflow.com/questions/10184411/thread-count-increases-a-lot-even-when-deleting-the-threads">Thread count increases a lot, even when deleting the threads</a></p> <p>I decided to move the object to the main thread before deleting it like this: </p> <pre><code>void WorkspaceBase::deleteFinishedUploader() { FileUploader *fileUploader = qobject_cast&lt;FileUploader*&gt;(sender()); if(fileUploader != NULL) { fileUploader-&gt;moveToThread(this-&gt;thread()); fileUploader-&gt;deleteLater(); } } </code></pre> <p>In windows I never got any warnings and it seem to work fine. Now in OSX I get the following warning eveytime this is done:</p> <pre><code>On Mac OS X, you might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded. QObject::moveToThread: Current thread (0x102a07180) is not the object's thread (0x116428090). Cannot move to target thread (0x102a07180) </code></pre> <p>I'm not too sure what the issue is but will try to describe my project as well as I can.</p> <p>First I have a shared dylib that is used by my other dylib and app. The other dylib uses the Shared.dylib and contains all the functionallity when uplodaing stuff to the internet (QNetworkAccessManager etc). Then I have my app which includes this dylib, as well as the shared.dylib (which contains some helper methods and parsers). These libs, along with the date_time.dylib from boost and qjson.framework is added to the .app-package. </p> <p>Everything builds and runs perfectly and it is ONLY when I'm trying to move the Uploader object to the main thread that this issue occur. The Uploader object is a part of the App executable and is not located in a .dylib (but it uses the libs to do the upload). </p> <p>What might be the issue here? Not to sure if I had this issue before and I'm not too sure what I have done. If the info I've provided is not enough, I'm happy to add more. Just hard to know where to look when I dont know what the issue is. </p> <p>Thanks!</p> <p>Edit: These are the libs that Im loading durring runtime:</p> <pre><code>dyld: loaded: /Users/me/Documents/MyApp/MyApp.app/Contents/MacOS/./MyApp dyld: loaded: /Users/me/Documents/MyApp/MyApp.app/Contents/MacOS/qjson.framework/Versions/0/qjson dyld: loaded: /Users/me/Documents/MyApp/MyApp.app/Contents/MacOS/libboost_date_time.dylib dyld: loaded: /Users/me/Documents/MyApp/MyApp.app/Contents/MacOS/libQt.Shared.1.dylib dyld: loaded: /Users/me/Documents/MyApp/MyApp.app/Contents/MacOS/libQt.Framework.Network.1.dylib dyld: loaded: /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtGui.framework/Versions/4/QtGui dyld: loaded: /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/QtCore dyld: loaded: /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtNetwork.framework/Versions/4/QtNetwork dyld: loaded: /usr/lib/libstdc++.6.dylib dyld: loaded: /usr/lib/libSystem.B.dylib dyld: loaded: /usr/lib/libz.1.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices dyld: loaded: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation dyld: loaded: /System/Library/Frameworks/Security.framework/Versions/A/Security dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices dyld: loaded: /usr/lib/system/libmathCommon.A.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis dyld: loaded: /usr/lib/libbsm.0.dylib dyld: loaded: /usr/lib/libicucore.A.dylib dyld: loaded: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit dyld: loaded: /usr/lib/system/libkxld.dylib dyld: loaded: /usr/lib/libauto.dylib dyld: loaded: /usr/lib/libobjc.A.dylib dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices dyld: loaded: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices dyld: loaded: /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration dyld: loaded: /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS dyld: loaded: /usr/lib/libsqlite3.dylib dyld: loaded: /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration dyld: loaded: /usr/lib/libxslt.1.dylib dyld: loaded: /usr/lib/libxml2.2.dylib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib dyld: loaded: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib dyld: loaded: /usr/lib/libcrypto.0.9.8.dylib dyld: loaded: /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib dyld: loaded: /usr/lib/libcups.2.dylib dyld: loaded: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation dyld: loaded: /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos dyld: loaded: /usr/lib/libresolv.9.dylib dyld: loaded: /Users/annatisch/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/lib/QtXml.framework/Versions/4/QtXml dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon dyld: loaded: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI dyld: loaded: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition dyld: loaded: /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI dyld: loaded: /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore dyld: loaded: /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv dyld: loaded: /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox dyld: loaded: /System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/FamilyControls dyld: loaded: /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport dyld: loaded: /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib dyld: loaded: /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL dyld: loaded: /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib dyld: loaded: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib dyld: loaded: /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio dyld: loaded: /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit dyld: loaded: /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib dyld: loaded: /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation dyld: loaded: /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory dyld: loaded: /System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Frameworks/CommerceCore.framework/Versions/A/CommerceCore dyld: loaded: /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory dyld: loaded: /System/Library/PrivateFrameworks/PasswordServer.framework/Versions/A/PasswordServer dyld: loaded: /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService dyld: loaded: /usr/lib/libsasl2.2.dylib dyld: loaded: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData dyld: loaded: /usr/lib/liblangid.dylib dyld: loaded: /usr/lib/libiconv.2.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Versions/A/Resources/ColorSyncDeprecated.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXType.A.dylib dyld: loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libTrueTypeScaler.dylib QDir( dyld: loaded: /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/plugins/bearer/libqcorewlanbearer.dylib dyld: loaded: /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN dyld: loaded: /Users/me/QtSDK1.2.1/Desktop/Qt/4.8.1/gcc/plugins/bearer/libqgenericbearer.dylib dyld: loaded: /usr/lib/libssl.0.9.8.dylib </code></pre> <p>I cant see any duplicates so it must have to do with the moving of the object. How would I be able to move the object to the main thread FROM the main thread. I've read somewhere that this is not possible for security reasons but I really need to move it so that it can be fully deleted (which means that it needs an event loop which is not its current QThread which will get killed)</p>