From 8efc51aefbfcc6a41d9acabe9383a337500b0049 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 6 Oct 2014 19:23:04 +0000 Subject: Tox: - password dialog for encrypted profile git-svn-id: http://svn.miranda-ng.org/main/trunk@10713 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_accounts.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'protocols/Tox/src/tox_accounts.cpp') diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index 875996b9a8..09eb5932c2 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -20,16 +20,24 @@ CToxProto* CToxProto::InitAccount(const char* protoName, const wchar_t* userName (LPARAM)userName); } - CToxProto *ppro = new CToxProto(protoName, userName); - accounts.insert(ppro); + CToxProto *proto = new CToxProto(protoName, userName); + if (proto->InitToxCore()) + { + accounts.insert(proto); + } + else + { + delete proto; + proto = NULL; + } - return ppro; + return proto; } -int CToxProto::UninitAccount(CToxProto* ppro) +int CToxProto::UninitAccount(CToxProto* proto) { - accounts.remove(ppro); - delete ppro; + accounts.remove(proto); + delete proto; return 0; } \ No newline at end of file -- cgit v1.2.3