From 797fa5a1ffc347d8e18a8194d2ed5d26b5ff769f Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 3 Mar 2015 18:55:10 +0000 Subject: Tox: fixed crash on options saving git-svn-id: http://svn.miranda-ng.org/main/trunk@12308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_search.cpp | 2 +- protocols/Tox/src/tox_services.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index 8ec4a35250..910b5497a9 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -12,7 +12,7 @@ ToxHexAddress ResolveToxAddressFromDnsRecordV1(const std::string &dnsRecord) return ToxHexAddress::Empty(); } -ToxHexAddress ResolveToxAddressFromDnsRecordV2(const std::string &dnsRecord) +ToxHexAddress ResolveToxAddressFromDnsRecordV2(const std::string &/*dnsRecord*/) { // unsupported /*std::smatch match; diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp index f970e5499a..136c7baa5b 100644 --- a/protocols/Tox/src/tox_services.cpp +++ b/protocols/Tox/src/tox_services.cpp @@ -5,6 +5,9 @@ INT_PTR __cdecl CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam) ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam)); setTString("Nick", nickname); - tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname)); + if (IsToxCoreInited()) + { + tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeT(nickname)), mir_tstrlen(nickname)); + } return 0; } -- cgit v1.2.3