C++ Qt有内存泄漏吗?

C++ Qt有内存泄漏吗?,c++,linux,memory-leaks,qt5,address-sanitizer,C++,Linux,Memory Leaks,Qt5,Address Sanitizer,我有一个简单的qt程序,如: int main(int argc, char *argv[]) { ::QApplication app(argc, argv); ::QWidget wgt; wgt.show(); return app.exec(); } 当我运行带有地址Sinitizer的程序时,它向我显示: ==13118==ERROR: LeakSanitizer: detected memory leaks Direct leak of 16 byte(s)

我有一个简单的qt程序,如:

int main(int argc, char *argv[]) {
  ::QApplication app(argc, argv);

  ::QWidget wgt;
  wgt.show();

  return app.exec();
}
当我运行带有地址Sinitizer的程序时,它向我显示:

==13118==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x519388 in operator new(unsigned long) (/home/andrej/Public/example/qt_ex/build/example+0x519388)
    #1 0x7fc0812f9af6 in QAccessible::queryAccessibleInterface(QObject*) /build/qt510base-g_oCIy/qt510base-5.10.1/src/gui/accessible/qaccessible.cpp:720
    #2 0x61300000003f  (<unknown module>)

Indirect leak of 8478 byte(s) in 10 object(s) allocated from:
    #0 0x4e1d60 in realloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1d60)
    #1 0x7fc0746597fc  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2d7fc)

Indirect leak of 808 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07465960c in _dbus_mem_pool_alloc (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2d60c)

Indirect leak of 528 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07463b75d  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf75d)

Indirect leak of 480 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc074638c37  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0xcc37)

Indirect leak of 464 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07465577f  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2977f)

Indirect leak of 448 byte(s) in 8 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc0746404bd in _dbus_credentials_new (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x144bd)

Indirect leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc07465f761  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x33761)

Indirect leak of 264 byte(s) in 3 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07464e5da  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x225da)

Indirect leak of 224 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07465678b in _dbus_hash_table_new (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2a78b)

Indirect leak of 192 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07464b70f in _dbus_message_loader_new (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x1f70f)

Indirect leak of 192 byte(s) in 4 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc07465f881  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x33881)

Indirect leak of 160 byte(s) in 4 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc07465f6fa  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x336fa)

Indirect leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x4e1d60 in realloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1d60)
    #1 0x7fc07464b8a1 in _dbus_message_loader_get_unix_fds (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x1f8a1)
    #2 0x814dc4b6fdfc79ff  (<unknown module>)

Indirect leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07464cf47  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x20f47)

Indirect leak of 96 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07463b728  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf728)

Indirect leak of 96 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07463b717  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf717)

Indirect leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc0746594b3 in _dbus_mem_pool_new (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2d4b3)

Indirect leak of 80 byte(s) in 4 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc07465752e in _dbus_strdup (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2b52e)

Indirect leak of 70 byte(s) in 2 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc074659d09 in _dbus_string_copy_data (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2dd09)
    #2 0x814dc4b6fdfc79ff  (<unknown module>)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x4e1d60 in realloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1d60)
    #1 0x7fc0746565e4  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2a5e4)

Indirect leak of 64 byte(s) in 8 object(s) allocated from:
    #0 0x4e18f8 in __interceptor_malloc (/home/andrej/Public/example/qt_ex/build/example+0x4e18f8)
    #1 0x7fc074659a43  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2da43)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc07464d362  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0x21362)

Indirect leak of 48 byte(s) in 2 object(s) allocated from:
    #0 0x4e1b10 in calloc (/home/andrej/Public/example/qt_ex/build/example+0x4e1b10)
    #1 0x7fc074639779  (/lib/x86_64-linux-gnu/libdbus-1.so.3+0xd779)

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x519388 in operator new(unsigned long) (/home/andrej/Public/example/qt_ex/build/example+0x519388)
    #1 0x7fc080dd9f75 in QtSharedPointer::ExternalRefCountData::getAndRef(QObject const*) /build/qt510base-g_oCIy/qt510base-5.10.1/src/corelib/tools/qsharedpointer.cpp:1452

Indirect leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x519388 in operator new(unsigned long) (/home/andrej/Public/example/qt_ex/build/example+0x519388)
    #1 0x7fc0812ffeb1 in QAccessibleObject::QAccessibleObject(QObject*) /build/qt510base-g_oCIy/qt510base-5.10.1/src/gui/accessible/qaccessibleobject.cpp:80
    #2 0x61300000003f  (<unknown module>)

SUMMARY: AddressSanitizer: 13468 byte(s) leaked in 81 allocation(s).
==13118==错误:LeakSanitizer:检测到内存泄漏
从以下位置分配的1个对象中16字节的直接泄漏:
#运算符new中的0 0x519388(无符号长)(/home/andrej/Public/example/qt_ex/build/example+0x519388)
#QAccessible::queryAccessibleInterface(QObject*)/build/qt510base-g_-oCIy/qt510base-5.10.1/src/gui/accessible/QAccessible中的1 0x7fc0812f9af6。cpp:720
#2 0x61300000003f()
从以下位置分配的10个对象中存在8478字节的间接泄漏:
#realloc中的0 0x4e1d60(/home/andrej/Public/example/qt_-ex/build/example+0x4e1d60)
#1 0x7fc0746597fc(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2d7fc)
从以下位置分配的2个对象中的808字节间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7FC0746590C在内存池alloc中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x2d60c)
从以下位置分配的2个对象中存在528字节的间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07463b75d(/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf75d)
从以下位置分配的2个对象中存在480字节的间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc074638c37(/lib/x86_64-linux-gnu/libdbus-1.so.3+0xcc37)
从以下位置分配的2个对象中间接泄漏464字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07465577f(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2977f)
从以下位置分配的8个对象中的448字节间接泄漏:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1个0x7fc0746404bd位于新的数据库中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x144bd)
从以下位置分配的7个对象中间接泄漏280字节:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1 0x7fc07465f761(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x33761)
在分配自以下地址的3个对象中间接泄漏264字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07464e5da(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x225da)
在分配自以下地址的2个对象中间接泄漏224字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07465678b位于新的哈希表中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x2a78b)
在分配自以下地址的2个对象中间接泄漏192字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07464b70f在dbus消息加载器中新(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x1f70f)
从以下位置分配的4个对象中间接泄漏192字节:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1 0x7fc07465f881(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x33881)
分配自以下位置的4个对象中160字节的间接泄漏:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1 0x7fc07465f6fa(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x336fa)
从以下位置分配的2个对象中的128字节间接泄漏:
#realloc中的0 0x4e1d60(/home/andrej/Public/example/qt_-ex/build/example+0x4e1d60)
#1 0x7fc07464b8a1在dbus消息加载程序get unix fds中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x1f8a1)
#2 0x814dc4b6fdfc79ff()
从以下位置分配的2个对象中的128字节间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07464cf47(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x20f47)
在分配自以下地址的2个对象中间接泄漏96字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07463b728(/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf728)
在分配自以下地址的2个对象中间接泄漏96字节:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07463b717(/lib/x86_64-linux-gnu/libdbus-1.so.3+0xf717)
从以下位置分配的2个对象中存在80字节的间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc0746594b3位于新的内存池中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x2d4b3)
从以下位置分配的4个对象间接泄漏80字节:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1个0x7fc07465752e在dbus标准中(/lib/x86\u 64-linux-gnu/libdbus-1.so.3+0x2b52e)
从以下位置分配的2个对象间接泄漏70字节:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1 0x7fc074659d09 in_dbus_string_copy_数据(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2dd09)
#2 0x814dc4b6fdfc79ff()
从以下位置分配的2个对象中的64字节间接泄漏:
#realloc中的0 0x4e1d60(/home/andrej/Public/example/qt_-ex/build/example+0x4e1d60)
#1 0x7fc0746565e4(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2a5e4)
从以下位置分配的8个对象中存在64字节的间接泄漏:
#0 0x4e18f8位于拦截程序malloc中(/home/andrej/Public/example/qt\u ex/build/example+0x4e18f8)
#1 0x7fc074659a43(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x2da43)
从以下位置分配的2个对象中存在48字节的间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc07464d362(/lib/x86_64-linux-gnu/libdbus-1.so.3+0x21362)
从以下位置分配的2个对象中存在48字节的间接泄漏:
#calloc中的0 0x4e1b10(/home/andrej/Public/example/qt_-ex/build/example+0x4e1b10)
#1 0x7fc074639779(/lib/x86_64-linux-gnu/libdbus-1.so.3+0xd779)
从以下位置分配的1个对象中有16个字节的间接泄漏:
#运算符new中的0 0x519388(无符号长)(/home/andrej/Public/example/qt_ex/build/example+0x519388)
#1 0x7