The IconvProcessor assignment operator did not delete pimpl_ and used a
non-standard signature. If you want to know why the standard signature is
important, read "Effective C++" by Scott Meyers.
~Impl()
{
if (cd != invalid_cd && iconv_close(cd) == -1)
- LYXERR0("Error returned from iconv_close(" << errno << ")");
+ LYXERR0("Error returned from iconv_close(" << errno << ')');
}
iconv_t cd;
}
-void IconvProcessor::operator=(IconvProcessor const & other)
+IconvProcessor & IconvProcessor::operator=(IconvProcessor const & other)
{
- if (&other != this)
+ if (&other != this) {
+ delete pimpl_;
pimpl_ = new Impl(other.pimpl_->tocode_, other.pimpl_->fromcode_);
+ }
+ return *this;
}
/// copy constructor needed because of pimpl_
IconvProcessor(IconvProcessor const &);
/// assignment operator needed because of pimpl_
- void operator=(IconvProcessor const &);
+ IconvProcessor & operator=(IconvProcessor const &);
/// destructor
~IconvProcessor();