From 54bff8ec8213acf63f2dae914560c9fac575dc45 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 17 May 2020 12:46:16 +0200 Subject: [PATCH] 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. Change-Id: I4c99c3a7f994044c3c3f0c08b35ae451c3ff9ea7 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2721 Reviewed-by: waddlesplash --- src/apps/deskbar/TimeView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp index 3cc669b480..c7de7b7ff7 100644 --- a/src/apps/deskbar/TimeView.cpp +++ b/src/apps/deskbar/TimeView.cpp @@ -110,8 +110,8 @@ TTimeView::TTimeView(BMessage* data) TTimeView::~TTimeView() { - if (fCalendarWindow != NULL) - fCalendarWindow->Quit(); + if (fCalendarWindowMessenger.IsValid()) + fCalendarWindowMessenger.PostMessage(B_QUIT_REQUESTED); delete fTimeFormat; delete fDateFormat;