author | simon <simon> | 2002-11-21 11:48:43 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-21 11:48:43 (UTC) |
commit | 74b4b55fd5f09c1b8f38228488aa5876e40c0ae3 (patch) (side-by-side diff) | |
tree | 89864acf81f4628c296e13279d59d0f6a1466e98 | |
parent | 8fd6ee827a8d0fce2ba318fb3715296a95c5556b (diff) | |
download | opie-74b4b55fd5f09c1b8f38228488aa5876e40c0ae3.zip opie-74b4b55fd5f09c1b8f38228488aa5876e40c0ae3.tar.gz opie-74b4b55fd5f09c1b8f38228488aa5876e40c0ae3.tar.bz2 |
- do proper reference counting on the ObexInterface object. reviewed by
sandman
-rw-r--r-- | core/launcher/irserver.cpp | 4 | ||||
-rw-r--r-- | core/launcher/irserver.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/core/launcher/irserver.cpp b/core/launcher/irserver.cpp index b22e064..2147d0a 100644 --- a/core/launcher/irserver.cpp +++ b/core/launcher/irserver.cpp @@ -14,12 +14,12 @@ IrServer::IrServer( QObject *parent, const char *name ) : QObject( parent, name ) { lib = 0; + iface = 0; QString path = QPEApplication::qpeDir() + "/plugins/obex/"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { - ObexInterface *iface = 0; QLibrary *trylib = new QLibrary( path + *it ); qDebug("trying lib %s", (path + (*it)).latin1() ); if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) { @@ -46,5 +46,7 @@ IrServer::IrServer( QObject *parent, const char *name ) IrServer::~IrServer() { + if ( iface ) + iface->release(); delete lib; } diff --git a/core/launcher/irserver.h b/core/launcher/irserver.h index f9f682f..b3434dd 100644 --- a/core/launcher/irserver.h +++ b/core/launcher/irserver.h @@ -5,6 +5,7 @@ class QCopChannel; class QLibrary; +struct ObexInterface; class IrServer : public QObject { @@ -15,6 +16,7 @@ public: private: QLibrary *lib; + ObexInterface *iface; }; #endif |