src: Fix crash on exit when deleting components (#789)
* build: add missing includes in header files * logic: delete components in reverse to creation order
This commit is contained in:
committed by
Eberhard Graether
parent
3f88aba025
commit
ee2d6662e8
@@ -15,6 +15,16 @@
|
||||
#include "ViewFactory.h"
|
||||
#include "logging.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
template <class Container>
|
||||
void reverseErase(Container & container)
|
||||
{
|
||||
while(!container.empty())
|
||||
container.pop_back();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
ComponentManager::ComponentManager(const ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
: m_componentFactory(viewFactory, storageAccess)
|
||||
{
|
||||
@@ -23,8 +33,8 @@ ComponentManager::ComponentManager(const ViewFactory* viewFactory, StorageAccess
|
||||
void ComponentManager::clear()
|
||||
{
|
||||
m_dialogViews.clear();
|
||||
m_components.clear();
|
||||
m_singleViews.clear();
|
||||
reverseErase(m_components);
|
||||
reverseErase(m_singleViews);
|
||||
}
|
||||
|
||||
void ComponentManager::setupMain(ViewLayout* viewLayout, Id appId)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <typeinfo>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "TokenComponent.h"
|
||||
#include "types.h"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#define CODEBLOCKS_COMPILER_H
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
class TiXmlElement;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user