Fixed Haiku runtime errors.
This commit is contained in:
parent
cce4419b9a
commit
5952ad368d
|
@ -40,6 +40,7 @@ struct queueMainArgs {
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// note: msg is owned by the BLooper base class and should not be freed by us
|
||||||
void uiprivApplication::MessageReceived(BMessage *msg)
|
void uiprivApplication::MessageReceived(BMessage *msg)
|
||||||
{
|
{
|
||||||
const void *data;
|
const void *data;
|
||||||
|
@ -55,7 +56,6 @@ void uiprivApplication::MessageReceived(BMessage *msg)
|
||||||
uiprivInternalError("BMessage::FindData() failed in uiprivApplication::MessageReceived() for uiQueueMain(): %ld", status);
|
uiprivInternalError("BMessage::FindData() failed in uiprivApplication::MessageReceived() for uiQueueMain(): %ld", status);
|
||||||
args = (const struct queueMainArgs *) data;
|
args = (const struct queueMainArgs *) data;
|
||||||
(*(args->f))(args->data);
|
(*(args->f))(args->data);
|
||||||
delete msg;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
BApplication::MessageReceived(msg);
|
BApplication::MessageReceived(msg);
|
||||||
|
@ -76,6 +76,8 @@ void uiprivSysQueueMain(void (*f)(void *data), void *data)
|
||||||
// TODO decide if we should just give up in this case like we do with user errors
|
// TODO decide if we should just give up in this case like we do with user errors
|
||||||
uiprivInternalError("BMessage::AddData() failed in uiQueueMain(): %ld", status);
|
uiprivInternalError("BMessage::AddData() failed in uiQueueMain(): %ld", status);
|
||||||
status = uiprivApp->PostMessage(msg);
|
status = uiprivApp->PostMessage(msg);
|
||||||
|
// msg is copied by PostMessage() so we can delete it here
|
||||||
|
delete msg;
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
uiprivInternalError("BApplication::PostMessage() failed in uiQueueMain(): %ld", status);
|
uiprivInternalError("BApplication::PostMessage() failed in uiQueueMain(): %ld", status);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue