File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 66#include " ModuleInternal.h"
77#include " MetadataBuilder.h"
88#include " SpinLock.h"
9+ #include " Caches.h"
910
1011namespace tns {
1112
@@ -73,6 +74,12 @@ class Runtime {
7374 std::unique_ptr<ModuleInternal> moduleInternal_;
7475 int workerId_;
7576 CFRunLoopRef runtimeLoop_;
77+ // TODO: refactor this. This is only needed because, during program termination (UIApplicationMain not called)
78+ // the Cache::Workers is released (static initialization order fiasco https://en.cppreference.com/w/cpp/language/siof)
79+ // so it released the Cache::Workers shared_ptr and then releases the Runtime unique_ptr
80+ // eventually we just need to refactor so that Runtime::Initialize is responsible for its initalization
81+ // and lifecycle
82+ std::shared_ptr<ConcurrentMap<int , std::shared_ptr<Caches::WorkerState>>> workerCache_;
7683};
7784
7885}
Original file line number Diff line number Diff line change 4141Runtime::Runtime () {
4242 currentRuntime_ = this ;
4343 workerId_ = -1 ;
44+ workerCache_ = Caches::Workers;
4445}
4546
4647Runtime::~Runtime () {
You can’t perform that action at this time.
0 commit comments