[mythtv-commits] Ticket #5482: PATCH: Purge unused database-connections after 3600 secs [SVN: Trunk]

MythTV mythtv at cvs.mythtv.org
Sat Jun 28 08:22:59 UTC 2008


#5482: PATCH: Purge unused database-connections after 3600 secs [SVN: Trunk]
---------------------------------------+------------------------------------
 Reporter:  tomimo at ncircle.nullnet.fi  |        Owner:  ijr    
     Type:  patch                      |       Status:  new    
 Priority:  minor                      |    Milestone:  unknown
Component:  mythtv                     |      Version:  head   
 Severity:  medium                     |   Resolution:         
  Mlocked:  0                          |  
---------------------------------------+------------------------------------

Comment(by tomimo at ncircle.nullnet.fi):

 In addition to the previous patch, the following change should be applied:

 diff -u -b -w mythdbcon.cpp mythdbcon.cpp.mod
 --- mythdbcon.cpp       2008-06-28 11:15:53.000000000 +0300
 +++ mythdbcon.cpp.mod   2008-06-28 11:15:43.000000000 +0300
 @@ -33,8 +33,8 @@
          m_db = QSqlDatabase();  // forces a destroy and must be done
 before
                                  // removeDatabase() so that connections
                                  // and queries are cleaned up correctly
 -        QSqlDatabase::removeDatabase(m_name);
      }
 +    QSqlDatabase::removeDatabase(m_name);
  }

  bool MSqlDatabase::isOpen()

 -----------------------------------
 As the QSqlDatabase::addDatabase() call is done in constructor regardles
 if the db-connection is openede or not, also the call to
 QSqlDatabase::removeDatabase should be done always when destroying the
 object. Currently, if the db-connection is for some reason never openeded,
 we possibly leak resources (or QSqlDatabase leaks resources).

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/5482#comment:1>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list