Skip to content

QtWS: Super Early Bird Tickets Available!

  • 0 Votes
    8 Posts
    6k Views
    JKSHJ

    @Bart_Vandewoestyne said:

    Could my educated guess be correct?

    Your guess sounds reasonable to me.

    Does anybody have any idea why the original author of this code decided to make a difference between linux and non-linux? If I remove the ifdef and simply use close() in all situations, things seem to work, although it seems that in this case the ClientSslSocket destructor is no longer called (and I'm not sure if this is a good thing...).

    Nope, sorry. Are there any comments in the code, or in the commit history? Could you ask the author directly?

    What would be the clean solution here? How should FooBar's destructor look like?

    It's hard to say without knowing how the rest of the program is designed. Maybe you can manually disconnect the socket before deleting it?

  • 0 Votes
    4 Posts
    18k Views
    B

    In the meanwhile, I have code for #3 too, see https://github.com/BartVandewoestyne/Qt/tree/master/tests/qobject_cast_test I'm sure it can be improved and made more elegant (see e.g. the TODO in the file). Comments, suggestions or pull requests are definitely still welcome!

    When I run this program on my computer, it shows me that qobject_cast is about 6 to 13 times faster than dynamic_cast.