summaryrefslogtreecommitdiff
path: root/idlc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-17 15:12:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-17 15:15:28 +0200
commit6ae487db5a1045d000c14604503e9c8f3bf24e30 (patch)
tree5178be02cb15ef3d964ad150b4de0088fddc7d1f /idlc/source
parentfb4296d14f0421e289afa5e456b75082cdf8716f (diff)
fix use of std::unique_ptr in Idlc
I removed the deletes in the destructor in commit b27fee9e0ebb445ce82baeade3b249807dca392b Date: Wed Jan 10 11:44:28 2018 +0200 loplugin:useuniqueptr cppu,idlc,io,ucbhelper but forgot to do the actual conversion Change-Id: Icb03070e1d8a2b10ccf892f01e9b44cc6bf0156f
Diffstat (limited to 'idlc/source')
-rw-r--r--idlc/source/idlc.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx
index 2e7467b8ac59..5e530968cb9b 100644
--- a/idlc/source/idlc.cxx
+++ b/idlc/source/idlc.cxx
@@ -209,7 +209,7 @@ Idlc::Idlc(Options* pOptions)
, m_offsetEnd(0)
, m_parseState(PS_NoState)
{
- m_pScopes = new AstStack();
+ m_pScopes.reset( new AstStack() );
// init root object after construction
m_pRoot = nullptr;
m_bGenerateDoc = m_pOptions->isValid("-C");
@@ -221,13 +221,12 @@ Idlc::~Idlc()
void Idlc::init()
{
- delete m_pRoot;
- m_pRoot = new AstModule(NT_root, OString(), nullptr);
+ m_pRoot.reset(new AstModule(NT_root, OString(), nullptr));
// push the root node on the stack
- m_pScopes->push(m_pRoot);
- initializePredefinedTypes(m_pRoot);
- predefineXInterface(m_pRoot);
+ m_pScopes->push(m_pRoot.get());
+ initializePredefinedTypes(m_pRoot.get());
+ predefineXInterface(m_pRoot.get());
}
void Idlc::reset()
@@ -247,13 +246,11 @@ void Idlc::reset()
m_documentation.clear();
m_pScopes->clear();
- delete m_pRoot;
-
- m_pRoot = new AstModule(NT_root, OString(), nullptr);
+ m_pRoot.reset( new AstModule(NT_root, OString(), nullptr) );
// push the root node on the stack
- m_pScopes->push(m_pRoot);
- initializePredefinedTypes(m_pRoot);
+ m_pScopes->push(m_pRoot.get());
+ initializePredefinedTypes(m_pRoot.get());
m_includes.clear();
}