diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-08-18 10:02:29 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-08-18 16:37:58 +0100 |
commit | 390fcb6c27b757b02c0e61776f920f32fcc77dcf (patch) | |
tree | 0246e99961566d3096e221d307a24496d0b1ecce /toxcore/tox.c | |
parent | a5e35180c7b42d30c82825cd67c8118ce048f65a (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.c | 4 |
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 | ||
241 | void tox_kill(Tox *tox) | 241 | void 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); |