@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?