X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Fregistry.cpp;h=661d2c7d6717d2ad9bd1f43768a3679fb38b96d3;hb=c8050984a289a6ea98812395313ef37d4c7fd059;hp=d93e469eaeea97185e39c9e61b7f9db0146fa261;hpb=5815060246f84e8efdf3143b4e8c7d00778168cf;p=evaf
diff --git a/src/libs/Common/registry.cpp b/src/libs/Common/registry.cpp
index d93e469..661d2c7 100644
--- a/src/libs/Common/registry.cpp
+++ b/src/libs/Common/registry.cpp
@@ -54,13 +54,13 @@ Registry::~Registry()
bool Registry::registerInterface(QString const & name, QObject * obj)
{
- mInterfaces.insert(name, QPointer(obj));
+ mInterfaces.insert(name, QWeakPointer(obj));
return true;
}
QObject * Registry::queryInterface(QString const & name) const
{
- QHash >::const_iterator it = mInterfaces.constFind(name);
- return it != mInterfaces.constEnd() ? *it : 0;
+ QHash >::const_iterator it = mInterfaces.constFind(name);
+ return it != mInterfaces.constEnd() ? (*it).data() : 0;
}