Permalink
Browse files

OscListener::ProcessMessage fix potential mem leak

fix potential memory leak in the osc cinder block file
"osxcListener.cpp": when "Message* message" is passed to
callback functions, add pointer deletion to avoid memory leak
  • Loading branch information...
1 parent e49647c commit 17a1fe60439d29eb0701b4c3bc8e55d0dba64d53 @david-demainlalune david-demainlalune committed Aug 22, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 blocks/osc/src/OscListener.cpp
@@ -139,10 +139,12 @@ void OscListener::ProcessMessage( const ::osc::ReceivedMessage &m, const IpEndpo
lock_guard<mutex> lock(mMutex);
- if( mMessageReceivedCbs.empty() )
+ if( mMessageReceivedCbs.empty() ){
mMessages.push_back( message );
- else
+ }else{
mMessageReceivedCbs.call( message );
+ delete message;
+ }
}
bool OscListener::hasWaitingMessages() const

0 comments on commit 17a1fe6

Please sign in to comment.