为什么heob在QCreator生成的代码中将这些检测为内存泄漏?

时间:2019-06-06 11:04:52

标签: c++ qt memory-leaks

我尝试修复我的应用程序中的内存泄漏,但大多数是来自QCreator生成的ui代码。他们真的是内存泄漏吗?例如,检测到这样的后缀。

spinBox_trainingPeriod->setSuffix(QString::fromUtf8(" sec."));

结果:

16 bytes in 1 blocks are lost in loss record 8949 of 8951 (#248981)
  in calloc in 
  1: calloc in 
  2: public: static class QString QInputMethod::tr(char const *,char const *,int) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  3: public: static class QString QInputMethod::tr(char const *,char const *,int) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  4: public: static class QString QInputMethod::tr(char const *,char const *,int) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  5: private: int QTextEngine::shapeTextWithHarfbuzzNG(struct QScriptItem const &,unsigned short const *,int,class QFontEngine *,class QVector<unsigned int> const &,bool,bool)const  in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  6: private: void QTextEngine::shapeText(int)const  in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  7: public: void QTextEngine::shape(int)const  in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  8: private: void QTextLine::layout_helper(int) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  9: public: void QTextLayout::endLayout(void) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Gui.dll
  10: private: int QWidgetLineControl::redoTextLayout(void)const  in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  11: private: void QWidgetLineControl::updateDisplayText(bool) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  12: private: bool QWidgetLineControl::finishChange(int,bool,bool) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  13: private: void QWidgetLineControl::internalSetText(class QString const &,int,bool) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  14: protected: virtual void QAbstractSpinBox::timerEvent(class QTimerEvent *) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  15: public: void QSpinBox::setSuffix(class QString const &) in C:/Qt/5.12.0/msvc2017_64/bin/Qt5Widgets.dll
  16: Ui_widget_eyeblink::setupUi in C:/git/eyeblink/build-blink-desktop_qt_5_12_0_msvc2017_64bit2-release/ui_gui.h:1751
  17: EyeblinkGUI::EyeblinkGUI in C:/git/eyeblink/sources/eyeblinkgui.cpp:157
  18: EyeblinkApplication::EyeblinkApplication in C:/git/eyeblink/sources/application.cpp:219
  19: main in C:/git/eyeblink/sources/main.cpp:160
  20: WinMain in C:/git/eyeblink/build-blink-Desktop_Qt_5_12_0_MSVC2017_64bit2-Release/release/eyeblink.exe
  21: __scrt_common_main_seh in f:/dd/vctools/crt/vcstartup/src/startup/exe_common.inl:288

1 个答案:

答案 0 :(得分:0)

这可能是heob中的错误,因为未检测到Deleaker。