Qt4.8 memory leak in QLineEdit::setReadOnly(true)



  • When we run valgrind on Qt 4.8.4 application using QLineEdit::SetReadOnly(true), it shows memory leak in input-context as shown below. Any suggestions on how to fix the same as it causes segmentation fault on target?

    1 bytes in 1 blocks are still reachable in loss record 1 of 244
    ==4063== at 0x402CE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==4063== by 0x6FFDBC0: _XlcDefaultMapModifiers (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
    ==4063== by 0x6FFDFFA: XSetLocaleModifiers (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
    ==4063== by 0x4D079BE: ??? (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)
    ==4063== by 0x4D05983: QInputContextFactory::create(QString const&, QObject*) (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)
    ==4063== by 0x46ABC51: QApplication::inputContext() const (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)
    ==4063== by 0x46F4707: QWidgetPrivate::inputContext() const (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)
    ==4063== by 0x4701140: QWidget::setAttribute(Qt::WidgetAttribute, bool) (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)
    ==4063== by 0x4B29433: QLineEdit::setReadOnly(bool) (in /home/gator/qt-4.8.4/lib/libQtGui.so.4.8.4)


  • Lifetime Qt Champion

    Hi,

    The first thing would likely be to update and use a more recent version of Qt. If not Qt 5 then at least Qt 4.8.7 which is the latest and last version of the Qt 4 series.


  • Qt Champions 2019

    @Ramakanth said in Qt4.8 memory leak in QLineEdit::setReadOnly(true):

    Any suggestions on how to fix the same as it causes segmentation fault on target?

    I don't think that this will cause a segfault - it's allocated once at application startup but not released during destruction which is not good but also not a big deal.


  • Banned

    This post is deleted!

  • Qt Champions 2019

    This post is deleted!

Log in to reply