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.
14 template<typename T
> struct IDVDResourceCounted
16 IDVDResourceCounted() : m_refs(1) {}
17 virtual ~IDVDResourceCounted() = default;
19 IDVDResourceCounted(const IDVDResourceCounted
&) = delete;
20 IDVDResourceCounted
&operator=(const IDVDResourceCounted
&) = delete;
25 return static_cast<T
*>(this);
28 virtual long Release()
30 long count
= --m_refs
;
33 delete static_cast<T
*>(this);
36 std::atomic
<long> m_refs
;