[mythtv-commits] Ticket #3381: Fix memory leak and other minor pthread usage issues in FIFOWriter

MythTV mythtv at cvs.mythtv.org
Mon Apr 30 05:01:00 UTC 2007


#3381: Fix memory leak and other minor pthread usage issues in FIFOWriter
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |       Owner:  ijr    
     Type:  patch      |      Status:  new    
 Priority:  minor      |   Milestone:  unknown
Component:  mythtv     |     Version:  head   
 Severity:  medium     |  
-----------------------+----------------------------------------------------
 This patch addresses a few issues that I noticed while browsing through
 libs/libmythtv/fifowriter.cpp:

  * The array of locks, fifo_lock, was not deleted in the FIFOWriter
 destructor.
  * pthread_mutex_init() was not called on the array of locks in the
 FIFOWriter constructor.  This is usually not that big of a deal on Linux
 because the default initial value of pthread_mutex_t is zeroed out.
 However, it can lead to weird problems on other platforms.
  * pthread_mutex_destroy() and pthread_cond_destroy() were not called on
 the two arrays of thread conditions and the one array of locks in the
 FIFOWriter destructor.  This can potentially create memory leaks.
  * There are two places where the empty_cond condition is signaled without
 locking the appropriate mutex.

 IRC: russellb

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3381>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list