ActivityMonitor: Fix leak of message when saving settings.
Adding a message to a message does not transfer ownership.
This commit is contained in:
parent
ea9f4d993c
commit
8361c0f11a
@ -335,15 +335,13 @@ ActivityWindow::_SaveSettings()
|
|||||||
if (view == NULL)
|
if (view == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BMessage* viewState = new BMessage;
|
BMessage viewState;
|
||||||
status = view->SaveState(*viewState);
|
status = view->SaveState(viewState);
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = settings.AddMessage("activity view", viewState);
|
status = settings.AddMessage("activity view", &viewState);
|
||||||
if (status != B_OK) {
|
if (status != B_OK)
|
||||||
delete viewState;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (status == B_OK)
|
if (status == B_OK)
|
||||||
status = settings.Flatten(&file);
|
status = settings.Flatten(&file);
|
||||||
|
Loading…
Reference in New Issue
Block a user