Ticket #4957: libs_libmythtv_filtermanager.cpp-dlcose-dl.patch

File libs_libmythtv_filtermanager.cpp-dlcose-dl.patch, 947 bytes (added by Erik Hovland <erik@…>, 13 years ago)

does a dlcose at the end of the LoadFilterLib?() member function

  • libs/libmythtv/filtermanager.cpp

    The dynlib file handle should be closed so that we do not leak
    
    From: Erik Hovland <erik@hovland.org>
    
    the file handle when we are done with the symbol.
    ---
    
     libs/libmythtv/filtermanager.cpp |    6 ++++++
     1 files changed, 6 insertions(+), 0 deletions(-)
    
    diff --git a/libs/libmythtv/filtermanager.cpp b/libs/libmythtv/filtermanager.cpp
    index 11f1b6d..eccdadb 100644
    a b void FilterManager::LoadFilterLib(QString Path) 
    139139                Filters.append(NewFilt);
    140140            }
    141141        }
     142        // we should be able to safely close the dynlib file
     143        // handle here. The dl* calls ref count the handle. So closing
     144        // (and decrementing the count) here is what we should do. That
     145        // way if the symbol is removed the ref count will fall to zero
     146        // and the handle will be reclaimed.
     147        dlclose(handle);
    142148    }
    143149}
    144150