[haiku-commits] Change in haiku[master]: TimeView: fix direct messaging to another window

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 17 May 2020 11:57:52 +0000

From Adrien Destugues <pulkomandy@xxxxxxxxx>:

Adrien Destugues has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/2721 ;)


Change subject: TimeView: fix direct messaging to another window
......................................................................

TimeView: fix direct messaging to another window

The window may be gone (if its B_QUIT_REQUESTED was called before the
main Deskbar window one), so we can't safely call Quit() on it. Instead,
just send a B_QUIT_REQUESTED through the BMessenger, which is a bit
safer.

Should fix #16026.
---
M src/apps/deskbar/TimeView.cpp
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/21/2721/1

diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp
index 3cc669b..c7de7b7 100644
--- a/src/apps/deskbar/TimeView.cpp
+++ b/src/apps/deskbar/TimeView.cpp
@@ -110,8 +110,8 @@

 TTimeView::~TTimeView()
 {
-       if (fCalendarWindow != NULL)
-               fCalendarWindow->Quit();
+       if (fCalendarWindowMessenger.IsValid())
+               fCalendarWindowMessenger.PostMessage(B_QUIT_REQUESTED);

        delete fTimeFormat;
        delete fDateFormat;

--
To view, visit https://review.haiku-os.org/c/haiku/+/2721
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I4c99c3a7f994044c3c3f0c08b35ae451c3ff9ea7
Gerrit-Change-Number: 2721
Gerrit-PatchSet: 1
Gerrit-Owner: Adrien Destugues <pulkomandy@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: TimeView: fix direct messaging to another window - Gerrit