[libnotificationmanager] Fix memory leak

In an &operator= we already have an object. It will have the d-pointer
already allocated.

If we create a new private implementation our old one leaks
wilder-5.24
David Edmundson 4 years ago committed by Fushan Wen
parent 49b60051a1
commit 079552b315
  1. 2
      libnotificationmanager/notification.cpp

@ -449,7 +449,7 @@ Notification::Notification(Notification &&other) noexcept
Notification &Notification::operator=(const Notification &other)
{
d = new Private(*other.d);
*d = *other.d;
return *this;
}

Loading…
Cancel
Save