From 9394884bcaa6515781623d40e5a1719cc890cfad Mon Sep 17 00:00:00 2001 From: henrypp Date: Fri, 8 Nov 2019 02:47:18 +0600 Subject: [PATCH] fixed overwrite notifications --- src/notifications.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/notifications.cpp b/src/notifications.cpp index e49dd608..9b677ecf 100644 --- a/src/notifications.cpp +++ b/src/notifications.cpp @@ -84,7 +84,7 @@ bool _app_notifycommand (HWND hwnd, INT button_id, time_t seconds) bool _app_notifyadd (HWND hwnd, PR_OBJECT ptr_log_object, PITEM_APP ptr_app) { - if (!ptr_app || ptr_app->pnotification || !ptr_log_object) + if (!ptr_app || !ptr_log_object) { _r_obj_dereference (ptr_log_object); return false; @@ -115,7 +115,10 @@ bool _app_notifyadd (HWND hwnd, PR_OBJECT ptr_log_object, PITEM_APP ptr_app) // remove existing log item (if exists) if (ptr_app->pnotification) + { _r_obj_dereference (ptr_app->pnotification); + ptr_app->pnotification = nullptr; + } ptr_app->pnotification = ptr_log_object;