Hello,
Here is some old patches I did for KDE 3.5 you may also be
interested in applying to Trinity, as they fix some annoying issues with
knetworkmanager.
The first patch fixes a memory leak in dbus-1-qt3, which
cause knetworkmanager to leak about 4 megs/hour. Basically, the function
QDBusConnection::sendWithReply() encapsulates the reply with
QDBusMessage::fromDBusMessage(), the problem is
dbus_connection_send_with_reply_and_block() already dbus_message_ref() the
message, and QDBusMessage::fromDBusMessage() do it again. So, when the
QDBusMessage object is later destroyed, dbus_message_unref() is called but
the refcount is still at 1... so the message never get free'd. I tried
removing the _ref() from QDBusMessage::fromDBusMessage(), but then
knetworkmanager crashes, so I guess some messages are actually copied using
this function somewhere else in the code. Simply using _unref() on the
reply in QDBusConnection::sendWithReply() before returning looks like the
most pragmatic solution.
--- qdbusconnection.cpp 2008-06-06
02:35:56.000000000 +0800
+++ qdbusconnection.cpp.new 2011-10-30
21:45:06.300981252 +0800
@@ -285,7 +285,12 @@
dbus_message_unref(msg);
-
return QDBusMessage::fromDBusMessage(reply);
+ QDBusMessage mess =
QDBusMessage::fromDBusMessage(reply);
+
+ /* XXX fromDbusMessage do a
ref(), avoid leaking */
+ dbus_message_unref(reply);
+
+ return mess;
}
void QDBusConnection::flush() const
I have another patch to remove the
very annoying lag when typing a WPA passphrase in the "Add connection"
wizard. The code is very bad, it computes the hash of the passphrase every
time the user inputs a character, so typing is slow and laggy even on my i7
CPU. Here is a fix to only compute the hash when the QLineEdit lose focus.
patch -l -p0
knetworkmanager-connection_setting_wireless_security_widget.h