the heob get the output .I dont understand how to fix the problem.
-
<unique>0x0005BA26</unique> <tid>1</tid> <threadname>CrBrowserMain</threadname> <kind>Leak_DefinitelyLost</kind> <xwhat> <text>1024 bytes in 1 blocks are lost in loss record 1309 of 83115 (#375334)</text> <leakedbytes>1024</leakedbytes> <leakedblocks>1</leakedblocks> </xwhat> <stack> <frame> <fn>malloc</fn> </frame> <frame> <ip>0x0F91A4E0</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>struct QImageData * QImageData::create(class QSize const &,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F911634</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>QImage::QImage(class QSize const &,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F911676</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>QImage::QImage(int,int,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F918E92</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>class QImage QImage::convertToFormat_helper(enum QImage::Format,class QFlags<enum Qt::ImageConversionFlag>)const </fn> </frame> <frame> <ip>0x0F804AFD</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>unsigned char QImage::convertToFormat(QImage::W4Format::AV1,class QFlags<enum Qt::ImageConversionFlag>)const volatile </fn> </frame> <frame> <ip>0x0F956E84</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QRasterPlatformPixmap::createPixmapForImage(class QImage,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F95648A</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QRasterPlatformPixmap::fromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F94DDF9</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>class QPixmap QPixmap::fromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F94E3D2</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>bool QPixmap::convertFromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F95F5F3</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>struct QPixmapIconEngineEntry * QPixmapIconEngine::tryMatch(class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x0F95CED4</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QPixmapIconEngine::addFile(class QString const &,class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x0F95AE71</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QIcon::addFile(class QString const &,class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x64A62809</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QCommonStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64A627A4</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QCommonStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64AEC591</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QFusionStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64A8867C</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QString QProxyStyle::trUtf8(char const *,char const *,int)</fn> </frame> <frame> <ip>0x507216E6</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5WebEngineWidgetsd.dll</obj> <fn>class QAction * QWebEnginePage::action(enum QWebEnginePage::WebAction)const </fn> </frame> <frame> <ip>0x5074132F</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5WebEngineWidgetsd.dll</obj> <fn>class QAction * QWebEngineView::pageAction(enum QWebEnginePage::WebAction)const </fn> </frame>QAction * t_action = NULL;
t_action = pageAction(QWebEnginePage::Back);
here's the error line.I dont know why.this output just said the pageAction get an Leak_DefinitelyLost .so how to fix it. -
<unique>0x0005BA26</unique> <tid>1</tid> <threadname>CrBrowserMain</threadname> <kind>Leak_DefinitelyLost</kind> <xwhat> <text>1024 bytes in 1 blocks are lost in loss record 1309 of 83115 (#375334)</text> <leakedbytes>1024</leakedbytes> <leakedblocks>1</leakedblocks> </xwhat> <stack> <frame> <fn>malloc</fn> </frame> <frame> <ip>0x0F91A4E0</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>struct QImageData * QImageData::create(class QSize const &,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F911634</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>QImage::QImage(class QSize const &,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F911676</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>QImage::QImage(int,int,enum QImage::Format)</fn> </frame> <frame> <ip>0x0F918E92</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>class QImage QImage::convertToFormat_helper(enum QImage::Format,class QFlags<enum Qt::ImageConversionFlag>)const </fn> </frame> <frame> <ip>0x0F804AFD</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>unsigned char QImage::convertToFormat(QImage::W4Format::AV1,class QFlags<enum Qt::ImageConversionFlag>)const volatile </fn> </frame> <frame> <ip>0x0F956E84</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QRasterPlatformPixmap::createPixmapForImage(class QImage,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F95648A</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QRasterPlatformPixmap::fromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F94DDF9</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>class QPixmap QPixmap::fromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F94E3D2</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>bool QPixmap::convertFromImage(class QImage const &,class QFlags<enum Qt::ImageConversionFlag>)</fn> </frame> <frame> <ip>0x0F95F5F3</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>struct QPixmapIconEngineEntry * QPixmapIconEngine::tryMatch(class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x0F95CED4</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QPixmapIconEngine::addFile(class QString const &,class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x0F95AE71</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Guid.dll</obj> <fn>void QIcon::addFile(class QString const &,class QSize const &,enum QIcon::Mode,enum QIcon::State)</fn> </frame> <frame> <ip>0x64A62809</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QCommonStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64A627A4</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QCommonStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64AEC591</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QIcon QFusionStyle::standardIcon(enum QStyle::StandardPixmap,class QStyleOption const *,class QWidget const *)const </fn> </frame> <frame> <ip>0x64A8867C</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5Widgetsd.dll</obj> <fn>class QString QProxyStyle::trUtf8(char const *,char const *,int)</fn> </frame> <frame> <ip>0x507216E6</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5WebEngineWidgetsd.dll</obj> <fn>class QAction * QWebEnginePage::action(enum QWebEnginePage::WebAction)const </fn> </frame> <frame> <ip>0x5074132F</ip> <obj>D:\program\qt\5.14.1\msvc2017\bin\Qt5WebEngineWidgetsd.dll</obj> <fn>class QAction * QWebEngineView::pageAction(enum QWebEnginePage::WebAction)const </fn> </frame>QAction * t_action = NULL;
t_action = pageAction(QWebEnginePage::Back);
here's the error line.I dont know why.this output just said the pageAction get an Leak_DefinitelyLost .so how to fix it.@nicker-player Well, you do not free memory t_action points to /which is fine as it is managed somewhere else). This is a false positive, because the tool does not know where the memory of the QAction instance is freed. You will get many false positives using Qt.
-
@nicker-player Well, you do not free memory t_action points to /which is fine as it is managed somewhere else). This is a false positive, because the tool does not know where the memory of the QAction instance is freed. You will get many false positives using Qt.
@jsulm said in the heob get the output .I dont understand how to fix the problem.:
which is fine as it is managed somewhere else). This is a false positive, because the tool does not know where the memory of the QAction instance is freed.
Why is this a false positive/how do you know it is managed elsewhere/freed? https://doc.qt.io/qt-6/qwebengineview.html#pageAction does not say if it is allocated, whether it is owned/whether you have to free it. But maybe you do have to free it? The two lines of code shown by OP just show it being assigned to a local variable and we don't know what happens to that.
-
@jsulm said in the heob get the output .I dont understand how to fix the problem.:
which is fine as it is managed somewhere else). This is a false positive, because the tool does not know where the memory of the QAction instance is freed.
Why is this a false positive/how do you know it is managed elsewhere/freed? https://doc.qt.io/qt-6/qwebengineview.html#pageAction does not say if it is allocated, whether it is owned/whether you have to free it. But maybe you do have to free it? The two lines of code shown by OP just show it being assigned to a local variable and we don't know what happens to that.
-
@JonB "For a custom context menu, or for embedding actions in a menu or toolbar, the individual actions are available via pageAction(). The web view maintains the state of the returned actions" (from that doc link).
@jsulm
Hmm, I wish thepageAction()description also referenced the top of the document! But fair enough, looks like the actions returned are already member of the web view. But have no idea then why "heob" says that line causes a leak, it wouldn't know, it's just a pointer not an allocation. valgrind at least only reports on blocks which are actually unfreed at exit time, don't know about heob. I wonder whether the OP is (not) allowing their wholeQWebEngineViewto be disposed before exit?I can only say that using valgrind on Linux I have never got a single "spurious"/"incorrect" leak report on a Qt program. (It is possible I have not tested with a
QWebEngineView.)