Service Kit: Fix behavior in release mode
* Code put inside an ASSERT will not be executed at all in release mode. * In release builds, don't print any messages to the standard output.
This commit is contained in:
parent
bb1d0adcd1
commit
7895042a8a
@ -127,5 +127,10 @@ BUrlProtocolDispatchingListener::_SendMessage(BMessage* message,
|
||||
message->AddPointer(kUrlProtocolCaller, caller);
|
||||
message->AddInt8(kUrlProtocolMessageType, notification);
|
||||
|
||||
ASSERT(fMessenger.SendMessage(message) == B_OK);
|
||||
#ifdef DEBUG
|
||||
status_t result = fMessenger.SendMessage(message);
|
||||
ASSERT(result == B_OK);
|
||||
#else
|
||||
fMessenger.SendMessage(message);
|
||||
#endif
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ void
|
||||
BUrlProtocolListener::DebugMessage(BUrlRequest* caller,
|
||||
BUrlProtocolDebugMessage type, const char* text)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
switch (type) {
|
||||
case B_URL_PROTOCOL_DEBUG_TEXT:
|
||||
cout << " ";
|
||||
@ -88,4 +89,5 @@ BUrlProtocolListener::DebugMessage(BUrlRequest* caller,
|
||||
}
|
||||
|
||||
cout << " " << caller->Protocol() << ": " << text << endl;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user