|
|
@@ -59,6 +59,8 @@
|
|
|
#include "../SVG/SVGPlugin.h"
|
|
|
#endif
|
|
|
|
|
|
+#include "Pool.h"
|
|
|
+
|
|
|
|
|
|
namespace Rml {
|
|
|
|
|
|
@@ -80,6 +82,9 @@ static bool initialised = false;
|
|
|
using ContextMap = UnorderedMap< String, ContextPtr >;
|
|
|
static ContextMap contexts;
|
|
|
|
|
|
+// The ObserverPtrBlock pool
|
|
|
+extern Pool<ObserverPtrBlock>* observerPtrBlockPool;
|
|
|
+
|
|
|
#ifndef RMLUI_VERSION
|
|
|
#define RMLUI_VERSION "custom"
|
|
|
#endif
|
|
|
@@ -178,6 +183,9 @@ void Shutdown()
|
|
|
default_file_interface.reset();
|
|
|
|
|
|
Log::Shutdown();
|
|
|
+
|
|
|
+ // Release any memory pools
|
|
|
+ ReleaseMemoryPools();
|
|
|
}
|
|
|
|
|
|
// Returns the version of this RmlUi library.
|
|
|
@@ -371,4 +379,13 @@ void ReleaseCompiledGeometry()
|
|
|
return GeometryDatabase::ReleaseAll();
|
|
|
}
|
|
|
|
|
|
+void ReleaseMemoryPools()
|
|
|
+{
|
|
|
+ if (observerPtrBlockPool && observerPtrBlockPool->GetNumAllocatedObjects() <= 0)
|
|
|
+ {
|
|
|
+ delete observerPtrBlockPool;
|
|
|
+ observerPtrBlockPool = nullptr;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
} // namespace Rml
|