diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-20 19:10:44 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-20 19:10:44 +0000 |
commit | 9f98d623506e7b7a86561152807526aeb2bb5be3 (patch) | |
tree | 271ff3535fa7cc8d2d74f82aebe179312c69aa9a /protocols/Omegle/src/messages.cpp | |
parent | c913257a1eb9b0fdcac33c1b45b309261048f761 (diff) |
Omegle: Various code improvements (as reported by Coverity analyser); version bump
This also fixes no locking of EventsLoop (and eventually related issues)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11545 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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)
|