diff options
Diffstat (limited to 'protocols/Tox/src/tox_accounts.cpp')
-rw-r--r-- | protocols/Tox/src/tox_accounts.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
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 |