diff options
Diffstat (limited to 'protocols/Omegle/src/messages.cpp')
-rw-r--r-- | protocols/Omegle/src/messages.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/protocols/Omegle/src/messages.cpp b/protocols/Omegle/src/messages.cpp index e7655c421c..17647bc813 100644 --- a/protocols/Omegle/src/messages.cpp +++ b/protocols/Omegle/src/messages.cpp @@ -29,18 +29,17 @@ void OmegleProto::SendMsgWorker(void *p) ScopedLock s( facy.send_message_lock_ );
- std::string *data = static_cast<std::string*>(p);
+ std::string data = *(std::string*)p;
+ delete (std::string*)p;
- *data = utils::text::trim(*data);
+ data = utils::text::trim(data);
- if (facy.state_ == STATE_ACTIVE && data->length() && facy.send_message( *data ))
+ if (facy.state_ == STATE_ACTIVE && data.length() && facy.send_message( data ))
{
- TCHAR *msg = mir_a2t_cp(data->c_str(), CP_UTF8);
+ TCHAR *msg = mir_a2t_cp(data.c_str(), CP_UTF8);
UpdateChat(facy.nick_, msg);
mir_free(msg);
}
-
- delete data;
}
void OmegleProto::SendTypingWorker(void *p)
@@ -50,7 +49,7 @@ void OmegleProto::SendTypingWorker(void *p) // Save typing info
bool typ = (*static_cast<int*>(p) == PROTOTYPE_SELFTYPING_ON);
- delete p;
+ delete (int*)p;
// Ignore same typing info
if (facy.typing_ == typ)
|