diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-09-16 18:52:29 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-09-16 18:52:29 +0000 |
commit | 3c00a78191f46c10f036c789a9ef358f0e049d61 (patch) | |
tree | 96741c418983d401ebba418b579793c8c4959d30 /protocols/Tox/src/tox_network.cpp | |
parent | ab46b98479555c7106087f7d62b6c89f320ca311 (diff) |
Tox:
- attempt to fix numerous crashes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15366 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_network.cpp')
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index ea090920c5..9520672494 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -7,7 +7,7 @@ bool CToxProto::IsOnline() void CToxProto::BootstrapNode(const char *address, int port, const char *hexKey)
{
- if (hexKey == NULL)
+ if (hexKey == NULL || toxThread == NULL)
return;
ToxBinAddress binKey(hexKey, TOX_PUBLIC_KEY_SIZE * 2);
TOX_ERR_BOOTSTRAP error;
@@ -101,14 +101,14 @@ void CToxProto::TryConnect() else if (m_iStatus++ > TOX_MAX_CONNECT_RETRIES)
{
SetStatus(ID_STATUS_OFFLINE);
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, (HANDLE)NULL, LOGINERR_NONETWORK);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NONETWORK);
logger->Log(__FUNCTION__": failed to connect to DHT");
}
}
void CToxProto::CheckConnection(int &retriesCount)
{
- if (!toxThread->isConnected)
+ if (!toxThread || !toxThread->isConnected)
{
TryConnect();
}
@@ -151,7 +151,7 @@ void CToxProto::PollingThread(void*) if (!InitToxCore())
{
SetStatus(ID_STATUS_OFFLINE);
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, (HANDLE)NULL, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
logger->Log(__FUNCTION__": leaving");
return;
}
|