QTBUG-15191 Memory Leak with XMLListModel, how to workaround in Qt4.7.0 on Maemo?
-
Cross-posting from qt-qml mailing list since I didn't get any reply. Sorry for the crime.
I developed a widget for Maemo which is dependent on XMLListModel. The widget
pulls stock quotes from Yahoo finance in regular intervals. Due to a known issue
with XMLListModel [1], there is a memory leak every time the model is reloaded.
However, I have to reload the model to get the latest quotes.I am aware that this memory leak will be fixed in Qt 4.8.0. However, I don't
know if/when Maemo will get the Qt update. Until then, I am looking for a
workaround to avoid the memory leak. Here is a skeleton of my code[2]. Can you
give me any suggestions?~Sudheer
[1] - http://bugreports.qt.nokia.com/browse/QTBUG-15191
[2] - http://pastebin.com/fpPmKj1L -
@hoanghua - I just stopped using XMLListModel. Now I use a ListModel and refresh it by removing all entries and populating with output from XmlHttpRequest through JavaScript. Painful to parse responseXML in JavaScript but it is much better than continuously leaking memory.