summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-08-18 10:02:29 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-08-18 16:37:58 +0100
commit390fcb6c27b757b02c0e61776f920f32fcc77dcf (patch)
tree0246e99961566d3096e221d307a24496d0b1ecce /toxcore/tox.c
parenta5e35180c7b42d30c82825cd67c8118ce048f65a (diff)
Allow NULL as argument to tox_kill.
This behaviour is consistent with free() and operator delete.
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index f43adabb..2d3c97a9 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -240,6 +240,10 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error)
240 240
241void tox_kill(Tox *tox) 241void tox_kill(Tox *tox)
242{ 242{
243 if (tox == NULL) {
244 return;
245 }
246
243 Messenger *m = tox; 247 Messenger *m = tox;
244 kill_groupchats(m->group_chat_object); 248 kill_groupchats(m->group_chat_object);
245 kill_messenger(m); 249 kill_messenger(m);