Skip to content

Commit

Permalink
fixed overwrite notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Nov 7, 2019
1 parent 70cf8ec commit 9394884
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/notifications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 9394884

Please sign in to comment.