From a99ae7f4a5d09f973b403cde4a2ef5e4059f9f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 15 Sep 2020 22:54:57 +0200 Subject: [PATCH] Installer: improve BMessage allocation Change-Id: I2da87c29c3e3720e67d22a8eede54eb5f32964ad Reviewed-on: https://review.haiku-os.org/c/haiku/+/3223 Reviewed-by: Rene Gollent --- src/apps/installer/InstallerWindow.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp index 3ae6e5438e..25c5375d33 100644 --- a/src/apps/installer/InstallerWindow.cpp +++ b/src/apps/installer/InstallerWindow.cpp @@ -640,15 +640,12 @@ InstallerWindow::QuitRequested() _QuitCopyEngine(false); - BMessage* quitWithInstallStatus = new BMessage(B_QUIT_REQUESTED); + BMessage quitWithInstallStatus(B_QUIT_REQUESTED); + quitWithInstallStatus.AddBool("install_complete", + fInstallStatus == kFinished); - if (fInstallStatus == kFinished) - quitWithInstallStatus->AddBool("install_complete", true); - else - quitWithInstallStatus->AddBool("install_compelte", false); - - fWorkerThread->PostMessage(quitWithInstallStatus); - be_app->PostMessage(quitWithInstallStatus); + fWorkerThread->PostMessage(&quitWithInstallStatus); + be_app->PostMessage(&quitWithInstallStatus); return true; }