mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Make IconvProcessor::Impl noncopyable
The compiler-generated copy-constructor and assigment operators would be wrong for IconvProcessor::Impl, since cd would be copied, and iconv_close() could thus be called twice on the same descriptor. The old code did work, but now IconvProcessor::Impl cannot be copied by accident in the future.
This commit is contained in:
parent
0e8fea0705
commit
c9c20dc23b
@ -52,8 +52,12 @@ namespace lyx {
|
||||
static const iconv_t invalid_cd = (iconv_t)(-1);
|
||||
|
||||
|
||||
struct IconvProcessor::Impl
|
||||
class IconvProcessor::Impl
|
||||
{
|
||||
// noncopyable because iconv_close() is called in destructor
|
||||
Impl(Impl const &);
|
||||
Impl & operator=(Impl const &);
|
||||
public:
|
||||
Impl(string const & to, string const & from)
|
||||
: cd(invalid_cd), tocode_(to), fromcode_(from)
|
||||
{}
|
||||
|
@ -68,7 +68,7 @@ private:
|
||||
/// \return true if the processor is ready to use.
|
||||
bool init();
|
||||
/// hide internals
|
||||
struct Impl;
|
||||
class Impl;
|
||||
Impl * pimpl_;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user