[K/N] Dispose ObjC objects from main thread on main thread. ^KT-56402

Merge-request: KT-MR-9515
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
This commit is contained in:
Alexander Shabalin
2023-04-26 07:35:44 +00:00
committed by Space Team
parent 5282e60328
commit 82f94015f1
18 changed files with 447 additions and 4 deletions
@@ -8,6 +8,7 @@
#include "CompilerConstants.hpp"
#include "Exceptions.h"
#include "KAssert.h"
#include "MainQueueProcessor.hpp"
#include "Memory.h"
#include "ObjCExportInit.h"
#include "ObjectAlloc.hpp"
@@ -135,6 +136,9 @@ RuntimeState* initRuntime() {
// Keep global variables in state as well.
if (firstRuntime) {
konan::consoleInit();
if (compiler::objcDisposeOnMain()) {
kotlin::initializeMainQueueProcessor();
}
#if KONAN_OBJC_INTEROP
Kotlin_ObjCExport_initialize();
#endif