April 11, 2011

SteveKing SteveKing
Lab Rat
105 posts

Engine not deleted by QDeclarativeView

 

Hi,

Not sure if I’m missing something here, but when I run memory leak checks on my application it reports a huge number, most of which seem to be caused by the QDeclarativeView not deleting its QDeclarativeEngine. I’m using 4.7.2.

To solve the problem I’ve sub-classed the View and am calling engine()->deleteLater(). As I haven’t seen a report on this before I assume I’m doing something stupid here so any help would be appreciated.

Thanks,
Steve

2 replies

April 11, 2011

Andre Andre
Robot Herder
6295 posts

Well, if I check the source code, I do see that QDeclarativeView deletes the engine. See qdeclarativeview.cpp line 136 (version 4.7.3 in the desctructor of QDeclarativeViewPrivate).

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 12, 2011

SteveKing SteveKing
Lab Rat
105 posts

Yep… which points that it’s either my code or a false positive.

I’ve just run the simple “Hello World” QML program through the tool (AQTime) and it also reports leaks so I guess I’ll have to give Valgrind a go on a Linux box instead.

 
  ‹‹ dynamically populate a VisualItemModel      QDeclarativeImageProvider with images loaded from network ››

You must log in to post a reply. Not a member yet? Register here!