io/ipchandler: add IpcHandler and qs msg

Also reworks the whole ipc system to use serialized variants.
This commit is contained in:
outfoxxed 2024-09-13 02:44:33 -07:00
parent 3690812919
commit 5e2fb14551
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
14 changed files with 1428 additions and 27 deletions

View file

@ -67,6 +67,10 @@ void EngineGeneration::destroy() {
this->watcher = nullptr;
}
for (auto* extension: this->extensions.values()) {
delete extension;
}
if (this->root != nullptr) {
QObject::connect(this->root, &QObject::destroyed, this, [this]() {
// prevent further js execution between garbage collection and engine destruction.
@ -285,6 +289,18 @@ void EngineGeneration::incubationControllerDestroyed() {
}
}
void EngineGeneration::registerExtension(const void* key, EngineGenerationExt* extension) {
if (this->extensions.contains(key)) {
delete this->extensions.value(key);
}
this->extensions.insert(key, extension);
}
EngineGenerationExt* EngineGeneration::findExtension(const void* key) {
return this->extensions.value(key);
}
void EngineGeneration::quit() {
this->shouldTerminate = true;
this->destroy();