Allow NULL as argument to tox_kill.

This behaviour is consistent with free() and operator delete.
This commit is contained in:
iphydf 2016-08-18 10:02:29 +01:00
parent a5e35180c7
commit 390fcb6c27
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -240,6 +240,10 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error)
void tox_kill(Tox *tox)
{
if (tox == NULL) {
return;
}
Messenger *m = tox;
kill_groupchats(m->group_chat_object);
kill_messenger(m);