Only delete old context after emitting context changed wiht new context when inporting json

This commit is contained in:
Jasper Homann 2026-08-07 12:34:55 +02:00 committed by myrtle
parent 9a4652e0f8
commit c73affb3dc
1 changed files with 6 additions and 5 deletions

View File

@ -369,13 +369,14 @@ void BaseMainWindow::open_json()
disableActions();
if (ctx->settings.find(ctx->id("synth")) == ctx->settings.end()) {
ArchArgs chipArgs = ctx->args;
ctx = std::unique_ptr<Context>(new Context(chipArgs));
std::unique_ptr<Context> new_ctx = std::unique_ptr<Context>(new Context(chipArgs));
#ifdef ARCH_HIMBAECHEL
ctx->uarch->with_gui = true;
ctx->uarch->init(ctx.get());
ctx->late_init();
new_ctx->uarch->with_gui = true;
new_ctx->uarch->init(new_ctx.get());
new_ctx->late_init();
#endif
Q_EMIT contextChanged(ctx.get());
Q_EMIT contextChanged(new_ctx.get());
ctx = std::move(new_ctx);
}
handler->load_json(ctx.get(), fileName.toStdString());
Q_EMIT updateTreeView();