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) |
139 | 139 | Filters.append(NewFilt); |
140 | 140 | } |
141 | 141 | } |
| 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); |
142 | 148 | } |
143 | 149 | } |
144 | 150 | |