Use member variable to avoid warning by handle lost without dlclose()
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
void load_symbols(void *handle);
public:
+ /**
+ * @brief Destroy the CLSymbolsEx object
+ */
+ ~CLSymbolsEx();
/** Get the static instance of CLSymbols.
*
* @return The static instance of CLSymbols.
private:
std::pair<bool, bool> _loaded{false, false};
+ void *_handle{nullptr};
};
} // namespace arm_compute
#endif /* __ARM_COMPUTE_OPENCLEX_H__ */
namespace arm_compute
{
+
+CLSymbolsEx::~CLSymbolsEx()
+{
+ if (_handle != nullptr)
+ {
+ dlclose(_handle);
+ }
+}
+
CLSymbolsEx &CLSymbolsEx::get()
{
static CLSymbolsEx symbols;
// Disable default loading and set status to successful
_loaded = std::make_pair(true, true);
+ // Workaround to avoid warning by handle lost without dlclose()
+ _handle = handle;
+
return true;
}