- QHash<QString, QWeakPointer<QObject> >::const_iterator it = mInterfaces.constFind(name);
- return it != mInterfaces.constEnd() ? (*it).data() : 0;
+ Interfaces::const_iterator it = mInterfaces.constFind(name);
+ return it != mInterfaces.constEnd() ? *it : 0;
+}
+
+void Registry::interfaceDestroyed(QObject * obj)
+{
+ // Interface object destroyed. Remove it from the list of registered
+ // interfaces.
+ Interfaces::iterator it = mInterfaces.begin();
+ Interfaces::const_iterator e = mInterfaces.end();
+ while (it != e) {
+ if (*it == obj) {
+ it = mInterfaces.erase(it);
+ }
+ else {
+ ++it;
+ }
+ }