aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsmemorypool_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/parser/qqmljsmemorypool_p.h')
-rw-r--r--src/qml/parser/qqmljsmemorypool_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/parser/qqmljsmemorypool_p.h b/src/qml/parser/qqmljsmemorypool_p.h
index 58768fd805..9a480f1224 100644
--- a/src/qml/parser/qqmljsmemorypool_p.h
+++ b/src/qml/parser/qqmljsmemorypool_p.h
@@ -83,6 +83,7 @@ public:
free(_blocks);
}
+ qDeleteAll(strings);
}
inline void *allocate(size_t size)
@@ -104,6 +105,11 @@ public:
template <typename Tp> Tp *New() { return new (this->allocate(sizeof(Tp))) Tp(); }
+ QStringRef newString(const QString &string) {
+ strings.append(new QString(string));
+ return QStringRef(strings.last());
+ }
+
private:
Q_NEVER_INLINE void *allocate_helper(size_t size)
{
@@ -143,6 +149,7 @@ private:
int _blockCount = -1;
char *_ptr = nullptr;
char *_end = nullptr;
+ QVector<QString*> strings;
enum
{