BAlert: fixed missing initialization of fAlertSem.

* Fixes bug #12372.
This commit is contained in:
Axel Dörfler 2015-09-14 20:33:38 +02:00
parent 4df20b63c0
commit b11399ff60
1 changed files with 6 additions and 2 deletions

View File

@ -335,9 +335,9 @@ BAlert::MessageReceived(BMessage* msg)
int32 which;
if (msg->FindInt32("which", &which) == B_OK) {
if (fAlertSem < B_OK) {
if (fAlertSem < 0) {
// Semaphore hasn't been created; we're running asynchronous
if (fInvoker) {
if (fInvoker != NULL) {
BMessage* out = fInvoker->Message();
if (out && (out->ReplaceInt32("which", which) == B_OK
|| out->AddInt32("which", which) == B_OK))
@ -490,6 +490,10 @@ BAlert::_Init(const char* text, const char* button0, const char* button1,
const char* button2, button_width buttonWidth, button_spacing spacing,
alert_type type)
{
fInvoker = NULL;
fAlertSem = -1;
fAlertValue = -1;
fIconView = new TAlertView();
fTextView = new BTextView("_tv_");