[Interest] Calling QT Class method from pthread thread

Gonzalo Aguilar Delgado gaguilar at aguilardelgado.com
Wed Oct 4 17:50:58 CEST 2017


Hi Konstantin,

That's something I was not aware of. So it's the best clue I heard today.

Oh men!!! You are sooooo great....

My Class address is 55a7ebe0

Received Class address is d15dddf0

Do you think that registering the address using this pointer here is 
wrong? Or it's just that there's a bug on the library that's passing me 
that value?         if(!sg64_zeromq_register_handler(mqsubscriber, 
callbackWrapper, *this*, &error)){ Best regards,
On 04/10/17 17:41, Konstantin Shegunov wrote:
> On Wed, Oct 4, 2017 at 6:39 PM, Gonzalo Aguilar Delgado 
> <gaguilar at aguilardelgado.com <mailto:gaguilar at aguilardelgado.com>> wrote:
>
>     Yes it is. Because the code of the function starts to execute. In
>     the example the processMessage. Until the operation stops on emit
>     and the program crash.
>
> emit requires you to have a valid `this` pointer, nothing before that, 
> unless I have missed something, does - you're using only local 
> variables. Most (if not all) compilers will still allow you to call 
> methods with invalid objects up to the point where the object (i.e. 
> `this`) is actually referenced.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171004/eeeb3aab/attachment.html>


More information about the Interest mailing list