Revision 533b96b...

Go back to digest for 18th November 2012

Bug Fixes in KDE Base

Daniel Calviño Sánchez committed changes in [kdelibs/KDE/4.9] kjsembed/kjsembed/qobject_binding.cpp:

Fix memory leak when connecting signals and slots through the QObject binding.

A char* was used to store the signal name, and another char* was used to
store the slot name. Each name was a deep copy of the data of a
QByteArray, made with qstrdup. The copies were not deleted, and this
caused the memory leak.

However, instead of explicitly deleting the copies, another approach was
taken. As they were copies of the data of a QByteArray, the type of the
signal and slot variables was changed to QByteArray, and the original
QByteArray was assigned without copying. Now, QByteArray will take care
of deallocating the memory when needed.

REVIEW: 107324

File Changes

Modified 1 files
  • kjsembed/kjsembed/qobject_binding.cpp
1 files changed in total