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:

            if(dlg_bye_all(dlg, NULL)<0)
                dlg_unref(dlg, 1);
            dlg_unref(dlg, 1);


Reply to this email directly or view it on GitHub.