[Interest] Memory leak in QML Image

Gunnar Roth gunnar.roth at gmx.de
Sun Jun 7 23:32:54 CEST 2015


I think there is a cache in QtQuick2  of  about 2mb size which holds unreferenced images. 
So you should at least find that the memory usage is saturating after a while.

Regards,
Gunnar Roth

> Am 07.06.2015 um 17:03 schrieb Igor Mironchik <igor.mironchik at gmail.com>:
> 
> Hi, guys again. I'm sorry but question is open.
> 
> I first thought I was wrong. But it's true: changing currentValue results to memory leak.
> 
> 06.06.2015 0:41, Igor Mironchik пишет:
>> Hi guys,
>> 
>> If in QML I have
>> 
>> property int currentValue
>> 
>> Image { id: curr; source: "" }
>> 
>> onCurrentValueChanged: {
>>         if(root.currentValue < 0 || root.currentValue > 9)
>>             root.currentValue = 0
>>         curr.source = "file:" + applicationDirPath + "/" + root.currentValue + ".png"
>>     }
>> 
>> And changing currentValue results to memory leak. I mean if I change currentValue cyclically.
>> 
>> How can I correctly free memory used by Image and load new image without memory leaks?
>> 
>> Thank you.
>> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150607/c57a9c53/attachment.html>


More information about the Interest mailing list