summaryrefslogtreecommitdiff
path: root/protocols/Omegle/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-03-01 11:59:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-03-01 11:59:11 +0300
commit8723007872879b769757fa17ea350a352cd58e27 (patch)
tree1f709adc2f203308a53c77230709a7b9e4d10fd3 /protocols/Omegle/src
parent7f803401a9d66ba3c5e7b3eb1986e76c3d49912d (diff)
fixes #2976 (Omegle: Miranda crash when using Omegle)
Diffstat (limited to 'protocols/Omegle/src')
-rw-r--r--protocols/Omegle/src/communication.cpp25
-rw-r--r--protocols/Omegle/src/connection.cpp11
-rw-r--r--protocols/Omegle/src/version.h2
3 files changed, 11 insertions, 27 deletions
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp
index e5e0f6a689..f033cd93a6 100644
--- a/protocols/Omegle/src/communication.cpp
+++ b/protocols/Omegle/src/communication.cpp
@@ -425,29 +425,10 @@ bool Omegle_client::stop()
http::response resp = flap(OMEGLE_REQUEST_STOP, &data);
- if (hConnection)
- Netlib_CloseHandle(hConnection);
- hConnection = nullptr;
+ Netlib_Shutdown(hConnection);
+ Netlib_Shutdown(hEventsConnection);
- if (hEventsConnection)
- Netlib_CloseHandle(hEventsConnection);
- hEventsConnection = nullptr;
-
- if (resp.data == "win") {
- return HANDLE_SUCCESS;
- }
- else {
- return HANDLE_ERROR(false);
- }
-
- /* switch ( resp.code )
- {
- case HTTP_CODE_OK:
- case HTTP_CODE_FOUND:
-
- default:
-
- }*/
+ return (resp.data == "win") ? HANDLE_SUCCESS : HANDLE_ERROR(false);
}
bool Omegle_client::events()
diff --git a/protocols/Omegle/src/connection.cpp b/protocols/Omegle/src/connection.cpp
index c75f12c584..7750fe9038 100644
--- a/protocols/Omegle/src/connection.cpp
+++ b/protocols/Omegle/src/connection.cpp
@@ -56,10 +56,6 @@ void OmegleProto::SignOff(void*)
delSetting("LogonTS");
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
-
- if (facy.hEventsConnection)
- Netlib_CloseHandle(facy.hEventsConnection);
- facy.hEventsConnection = nullptr;
}
void OmegleProto::StopChat(bool disconnect)
@@ -165,5 +161,12 @@ void OmegleProto::EventsLoop(void *)
}
ResetEvent(events_loop_lock_);
+
+ Netlib_CloseHandle(facy.hConnection);
+ facy.hConnection = nullptr;
+
+ Netlib_CloseHandle(facy.hEventsConnection);
+ facy.hEventsConnection = nullptr;
+
debugLogA("<<<<< Exiting OmegleProto::EventsLoop[%d]", tim);
}
diff --git a/protocols/Omegle/src/version.h b/protocols/Omegle/src/version.h
index 87daaf17c1..b0d8196bd2 100644
--- a/protocols/Omegle/src/version.h
+++ b/protocols/Omegle/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 3
-#define __BUILD_NUM 3
+#define __BUILD_NUM 4
#include <stdver.h>