[poppler] qt5/src

Adam Reichold adam.reichold at t-online.de
Wed Jan 10 07:57:05 UTC 2018


Hello,

Am 09.01.2018 um 23:41 schrieb Albert Astals Cid:
> +PageTransition& PageTransition::operator=(const PageTransition &other)
> +{
> +  if ( this != &other ) {
> +    delete data;
> +    data = new PageTransitionData(*other.data);
> +  }
> +
> +  return *this;
> +}
> +

In view of exception safety, I think it would be better to first create
the new data and then destroy the old one, i.e.:

std::unique_ptr<PageTransitionData> newData{new
PageTransitionData(*other.data)};
data.swap(newData);

(assuming PageTransition::data becomes a unique_ptr)

Regards, Adam.


More information about the poppler mailing list