*Doh* Always check the build _before_ checking in, not after. *sigh*
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2949 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#include "Utils.h"
|
||||
|
||||
/*!
|
||||
\brief Send a BMessage to a Looper target
|
||||
\param port Receiver port of the targeted Looper
|
||||
\param BMessage to send
|
||||
|
||||
This SendMessage takes ownership of the message sent, so deleting them after this
|
||||
call is unnecessary. Passing an invalid port will have unpredictable results.
|
||||
*/
|
||||
void SendMessage(port_id port, BMessage *message)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
|
||||
ssize_t flatsize=message->FlattenedSize();
|
||||
char *buffer=new char[flatsize];
|
||||
|
||||
if(message->Flatten(buffer,flatsize)==B_OK)
|
||||
write_port(port, message->what, buffer,flatsize);
|
||||
|
||||
delete buffer;
|
||||
delete message;
|
||||
}
|
||||
Reference in New Issue
Block a user