The unrefs should be ok. One is done in case bye was
not sent out, to destroy dialog faster, otherwise it will wait for the reply of the bye to
unref and destroy dialog.
I meant that the new code is this:
Reply to this email directly or view it on GitHub: