In destructor we do not need to create a copy off all pointers.
By hiding StringPool::strings in class private
section we reduce risk of it being accidentally copied.
Change-Id: I1b9df6bf9e49bd6926e84b8eac6b3d904277e50a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
namespace QQmlJS {
namespace VM {
-struct StringPool
+class StringPool
{
QHash<QString, String*> strings;
-
+public:
~StringPool()
- { qDeleteAll(strings.values()); }
+ {
+ qDeleteAll(strings);
+ }
String *newString(const QString &s)
{
QVector<ExceptionHandler> unwindStack;
Value exception;
- QScopedPointer<struct StringPool> stringPool;
+ QScopedPointer<class StringPool> stringPool;
QVector<Function *> functions;
ExecutionEngine(MemoryManager *memoryManager, EvalISelFactory *iselFactory);
}
private:
- friend struct StringPool;
+ friend class StringPool;
String(const QString &text)
: _text(text), _hashValue(0) {}
static const std::size_t CHUNK_SIZE = 65536;
+class StringPool;
struct MemoryManager::Data
{
bool enableGC;