loplugin:useuniqueptr in X11SalData

Change-Id: I61a6d5cc5690a2899986ec831655e480a1f414d1
Reviewed-on: https://gerrit.libreoffice.org/53360
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-04-23 15:23:08 +02:00
parent 182197448f
commit dbb1dbe7a7
2 changed files with 4 additions and 5 deletions

View File

@@ -56,7 +56,7 @@ class VCLPLUG_GEN_PUBLIC X11SalData : public GenericUnixSalData
XIOErrorHandler m_aOrigXIOErrorHandler;
protected:
SalXLib *pXLib_;
std::unique_ptr<SalXLib> pXLib_;
public:
X11SalData( GenericUnixSalDataType t, SalInstance *pInstance );
@@ -70,7 +70,7 @@ public:
void DeleteDisplay(); // for shutdown
SalXLib* GetLib() const { return pXLib_; }
SalXLib* GetLib() const { return pXLib_.get(); }
static void Timeout();

View File

@@ -270,13 +270,12 @@ void X11SalData::DeleteDisplay()
{
delete GetDisplay();
SetDisplay( nullptr );
delete pXLib_;
pXLib_ = nullptr;
pXLib_.reset();
}
void X11SalData::Init()
{
pXLib_ = new SalXLib();
pXLib_.reset(new SalXLib());
pXLib_->Init();
}