From 5d97f07d5c7848a453a29814d357bf91e8f2ce19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 13 Dec 2012 10:46:31 +0100 Subject: [PATCH] Use a smart pointer for ExecutionEngine::stringPool Change-Id: I5434fbd146e9d8dcc0000327c5a5b953bc744b83 Reviewed-by: Simon Hausmann --- qmljs_engine.cpp | 5 ++--- qmljs_engine.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/qmljs_engine.cpp b/qmljs_engine.cpp index 45db9fc..b65b358 100644 --- a/qmljs_engine.cpp +++ b/qmljs_engine.cpp @@ -73,8 +73,8 @@ ExecutionEngine::ExecutionEngine(MemoryManager *memoryManager, EvalISelFactory * { MemoryManager::GCBlocker gcBlocker(memoryManager); - stringPool = new StringPool; - memoryManager->setStringPool(stringPool); + stringPool.reset(new StringPool); + memoryManager->setStringPool(stringPool.data()); memoryManager->setExecutionEngine(this); rootContext = newContext(); @@ -212,7 +212,6 @@ ExecutionEngine::~ExecutionEngine() { delete globalObject.asObject(); delete rootContext; - delete stringPool; qDeleteAll(functions); } diff --git a/qmljs_engine.h b/qmljs_engine.h index bcaff09..16d8fc5 100644 --- a/qmljs_engine.h +++ b/qmljs_engine.h @@ -156,7 +156,7 @@ struct ExecutionEngine QVector unwindStack; Value exception; - struct StringPool *stringPool; + QScopedPointer stringPool; QVector functions; ExecutionEngine(MemoryManager *memoryManager, EvalISelFactory *iselFactory); -- 2.7.4