Changeset View
Changeset View
Standalone View
Standalone View
src/utils/dependencymanager.cpp
Show All 38 Lines | |||||
39 | 39 | | |||
40 | DependencyManager::DependencyManager(const DependencyManager &other) | 40 | DependencyManager::DependencyManager(const DependencyManager &other) | ||
41 | : m_cleanupFunctions(other.m_cleanupFunctions) | 41 | : m_cleanupFunctions(other.m_cleanupFunctions) | ||
42 | { | 42 | { | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | DependencyManager::~DependencyManager() | 45 | DependencyManager::~DependencyManager() | ||
46 | { | 46 | { | ||
47 | foreach (void (*cleanupFunction)(DependencyManager*), m_cleanupFunctions) { | 47 | for (const auto &cleanupFunction : qAsConst(m_cleanupFunctions)) { | ||
48 | cleanupFunction(this); | 48 | cleanupFunction(this); | ||
49 | } | 49 | } | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | DependencyManager &DependencyManager::operator=(const DependencyManager &other) | 52 | DependencyManager &DependencyManager::operator=(const DependencyManager &other) | ||
53 | { | 53 | { | ||
54 | m_cleanupFunctions = other.m_cleanupFunctions; | 54 | m_cleanupFunctions = other.m_cleanupFunctions; | ||
55 | return *this; | 55 | return *this; | ||
56 | } | 56 | } |