[video] fix selection after changing video or extra art
[xbmc.git] / xbmc / SectionLoader.h
blob20757c8fd93877d1ab4c76fc4fe9da572da69563
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "threads/CriticalSection.h"
13 #include <chrono>
14 #include <string>
15 #include <vector>
17 // forward
18 class LibraryLoader;
20 class CSectionLoader
22 public:
23 class CDll
25 public:
26 std::string m_strDllName;
27 long m_lReferenceCount;
28 LibraryLoader *m_pDll;
29 std::chrono::time_point<std::chrono::steady_clock> m_unloadDelayStartTick;
30 bool m_bDelayUnload;
32 CSectionLoader(void);
33 virtual ~CSectionLoader(void);
35 static LibraryLoader* LoadDLL(const std::string& strSection, bool bDelayUnload=true, bool bLoadSymbols=false);
36 static void UnloadDLL(const std::string& strSection);
37 static void UnloadDelayed();
38 void UnloadAll();
40 protected:
41 std::vector<CDll> m_vecLoadedDLLs;
42 CCriticalSection m_critSection;
46 extern CSectionLoader g_sectionLoader;