<commit_before>#include <Core/Engine.hh>
#include <limits>
#include <Core/AScene.hh>
#include <Systems/System.h>
#include <Core/EntityFilter.hpp>
#include <Entities/EntityFlags.hh>
#include <fstream>
#include <Threads/ThreadManager.hpp>
#include <Threads/MainThread.hpp>
#include <Components/ComponentRegistrationManager.hpp>
#include <Physics/Fallback/NullPhysics.hpp>
#include <Utils/Profiler.hpp>
#include <Entities/BinaryEntityPack.hpp>
#include <Entities/EntityBinaryPacker.hpp>
#include <Core/Link.hpp>

#include <BFC/BFCLinkTracker.hpp>
#include <BFC/BFCBlockManagerFactory.hpp>
#include "Graphic/GraphicElementManager.hpp"
#include "Graphic/DRBLightElementManager.hpp"

namespace AGE
{
	AScene::AScene(Engine *engine) :
		DependenciesInjector(engine)
		, _entityNumber(0)
		, _engine(engine)
		, _rootLink(std::make_unique<Link>())
	{
#ifdef AGE_BFC
		_bfcLinkTracker = new BFCLinkTracker();
		_bfcBlockManagerFactory = new BFCBlockManagerFactory();
		setInstance<GraphicElementManager>(_bfcBlockManagerFactory);
		setInstance<DRBLightElementManager>(_bfcBlockManagerFactory);
#endif
	}

	AScene::~AScene()
	{
#ifdef AGE_BFC
		delete _bfcLinkTracker;
		delete _bfcBlockManagerFactory;
#endif
		_systems.clear();
	}

	void 							AScene::update(float time)
	{
		SCOPE_profile_cpu_function("Scenes");
		for (auto &e : _systems)
		{
			if (e.second->isActivated())
				e.second->update(time);
		}
	}
<commit_msg>Leak at scene destuction cleared<commit_after>#include <Core/Engine.hh>
#include <limits>
#include <Core/AScene.hh>
#include <Systems/System.h>
#include <Core/EntityFilter.hpp>
#include <Entities/EntityFlags.hh>
#include <fstream>
#include <Threads/ThreadManager.hpp>
#include <Threads/MainThread.hpp>
#include <Components/ComponentRegistrationManager.hpp>
#include <Physics/Fallback/NullPhysics.hpp>
#include <Utils/Profiler.hpp>
#include <Entities/BinaryEntityPack.hpp>
#include <Entities/EntityBinaryPacker.hpp>
#include <Core/Link.hpp>

#include <BFC/BFCLinkTracker.hpp>
#include <BFC/BFCBlockManagerFactory.hpp>
#include "Graphic/GraphicElementManager.hpp"
#include "Graphic/DRBLightElementManager.hpp"

namespace AGE
{
	AScene::AScene(Engine *engine) :
		DependenciesInjector(engine)
		, _entityNumber(0)
		, _engine(engine)
		, _rootLink(std::make_unique<Link>())
	{
#ifdef AGE_BFC
		_bfcLinkTracker = new BFCLinkTracker();
		_bfcBlockManagerFactory = new BFCBlockManagerFactory();
		setInstance<GraphicElementManager>(_bfcBlockManagerFactory);
		setInstance<DRBLightElementManager>(_bfcBlockManagerFactory);
#endif
	}

	AScene::~AScene()
	{
		clearAllEntities();
#ifdef AGE_BFC
		delete _bfcLinkTracker;
		delete _bfcBlockManagerFactory;
#endif
		_systems.clear();
	}

	void 							AScene::update(float time)
	{
		SCOPE_profile_cpu_function("Scenes");
		for (auto &e : _systems)
		{
			if (e.second->isActivated())
				e.second->update(time);
		}
	}

{'fraction_non_alphanumeric': 0.13043478260869565, 'fraction_numerical': 0.0006956521739130435, 'mean_word_length': 6.412371134020619, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1876987', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1035, 'n_words': 159}