From 256658520668e10007764fe9054e48b7a286c3fd Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 12 Mar 2015 09:03:04 +0000 Subject: tox crash fix git-svn-id: http://svn.miranda-ng.org/main/trunk@12386 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_core.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp index 337ac9b2f7..5e1eae29d1 100644 --- a/protocols/Tox/src/tox_core.cpp +++ b/protocols/Tox/src/tox_core.cpp @@ -115,12 +115,15 @@ void CToxProto::UninitToxCore() transfers.Remove(transfer); } - ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick")))); - tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname)); + if (IsToxCoreInited()) + { + ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick")))); + tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname)); - //temporary - ptrA statusmes(mir_utf8encodeW(ptrT(getTStringA("StatusMsg")))); - tox_set_status_message(tox, (uint8_t*)(char*)statusmes, mir_strlen(statusmes)); + //temporary + ptrA statusmes(mir_utf8encodeW(ptrT(getTStringA("StatusMsg")))); + tox_set_status_message(tox, (uint8_t*)(char*)statusmes, mir_strlen(statusmes)); + } SaveToxProfile(); if (password != NULL) -- cgit v1.2.3