If I remember correctly, C++11 smart pointers need more maintenance when being passed on a message pump across threads, particularly from my memory of using it on Windows.[0]<p>When sending&#x2F;posting a smart pointer to a different thread&#x27;s message pump via a function like PostThreadMessage, the sending thread&#x27;s smart pointer would go out of scope and the memory would be released because the receiving thread hadn&#x27;t increased the reference count.  By the time the receiving thread&#x27;s message pump processed it, the pointer had already gone out of scope.<p>If you are using the producer-consumer pattern, most likely you&#x27;ll have to use unique pointers and call release manually; I guess that&#x27;s still better than using new and delete, right? Or perhaps I could try using SendMessage instead of PostMessage and read the return value to determine if the pointer got to the other side (for some reason, that wasn&#x27;t an option to me).<p>[0] <a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;11290912&#x2F;passing-objects-as-wparam-in-window-messages-using-smart-pointers" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;11290912&#x2F;passing-objects-...</a>