author | simon <simon> | 2002-11-21 11:48:43 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-21 11:48:43 (UTC) |
commit | 74b4b55fd5f09c1b8f38228488aa5876e40c0ae3 (patch) (unidiff) | |
tree | 89864acf81f4628c296e13279d59d0f6a1466e98 /core/launcher/irserver.cpp | |
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 |
1 files changed, 3 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 | |||
@@ -13,14 +13,14 @@ | |||
13 | IrServer::IrServer( QObject *parent, const char *name ) | 13 | IrServer::IrServer( QObject *parent, const char *name ) |
14 | : QObject( parent, name ) | 14 | : QObject( parent, name ) |
15 | { | 15 | { |
16 | lib = 0; | 16 | lib = 0; |
17 | iface = 0; | ||
17 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; | 18 | QString path = QPEApplication::qpeDir() + "/plugins/obex/"; |
18 | QDir dir( path, "lib*.so" ); | 19 | QDir dir( path, "lib*.so" ); |
19 | QStringList list = dir.entryList(); | 20 | QStringList list = dir.entryList(); |
20 | QStringList::Iterator it; | 21 | QStringList::Iterator it; |
21 | for ( it = list.begin(); it != list.end(); ++it ) { | 22 | for ( it = list.begin(); it != list.end(); ++it ) { |
22 | ObexInterface *iface = 0; | ||
23 | QLibrary *trylib = new QLibrary( path + *it ); | 23 | QLibrary *trylib = new QLibrary( path + *it ); |
24 | qDebug("trying lib %s", (path + (*it)).latin1() ); | 24 | qDebug("trying lib %s", (path + (*it)).latin1() ); |
25 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 25 | if ( trylib->queryInterface( IID_ObexInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
26 | lib = trylib; | 26 | lib = trylib; |
@@ -45,6 +45,8 @@ IrServer::IrServer( QObject *parent, const char *name ) | |||
45 | } | 45 | } |
46 | 46 | ||
47 | IrServer::~IrServer() | 47 | IrServer::~IrServer() |
48 | { | 48 | { |
49 | if ( iface ) | ||
50 | iface->release(); | ||
49 | delete lib; | 51 | delete lib; |
50 | } | 52 | } |