summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Tox/src/tox_core.cpp19
-rw-r--r--protocols/Tox/src/tox_options.cpp6
2 files changed, 13 insertions, 12 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 25e35c84dd..335743303b 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -119,17 +119,18 @@ bool CToxProto::InitToxCore()
void CToxProto::UninitToxCore()
{
- if (toxThread->toxAv)
- toxav_kill(toxThread->toxAv);
+ if (toxThread) {
+ if (toxThread->toxAv)
+ toxav_kill(toxThread->toxAv);
- if (toxThread->tox)
- {
- CancelAllTransfers();
+ if (toxThread->tox)
+ {
+ CancelAllTransfers();
- SaveToxProfile();
+ SaveToxProfile();
- tox_kill(toxThread->tox);
+ tox_kill(toxThread->tox);
+ }
+ toxThread = NULL;
}
-
- toxThread = NULL;
} \ No newline at end of file
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp
index 1954ecc147..fdd5d30a92 100644
--- a/protocols/Tox/src/tox_options.cpp
+++ b/protocols/Tox/src/tox_options.cpp
@@ -86,7 +86,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*)
if (m_proto->InitToxCore())
{
- TCHAR *group = m_group.GetText();
+ ptrT group(m_group.GetText());
if (mir_tstrlen(group) > 0 && Clist_GroupExists(group))
Clist_CreateGroup(0, group);
@@ -155,8 +155,8 @@ void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 0;
ofn.lpstrFile = profilePath;
- ofn.lpstrTitle = TranslateT("Save Tox profile"); \
- ofn.nMaxFile = MAX_PATH;
+ ofn.lpstrTitle = TranslateT("Save Tox profile");
+ ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_EXPLORER;
ofn.lpstrInitialDir = _T("%HOMEPATH%");