Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qml instance started with Exec_async doesn't close properly #145

Open
f-ij opened this issue Jun 3, 2022 · 3 comments
Open

Qml instance started with Exec_async doesn't close properly #145

f-ij opened this issue Jun 3, 2022 · 3 comments

Comments

@f-ij
Copy link

f-ij commented Jun 3, 2022

I need to open my file using exec_async, since I have an interactive simulation displaying and image, and otherwise it won't update the image. However, as opposed to starting just with exec(), if I close the QML window the QML engine is not closed. Due to this, if I try to exec_async() again from the same REPL, I get the error: ERROR: Existing engine, aborting creation. I have to close the REPL and recompile all functions again to open a new window.

@rasmushenningsson
Copy link
Contributor

On the main branch, there is a function QML.cleanup. After calling that, you can call exec_async again. (It's neither documented nor exported though, so it might change in the future.)

@ufechner7
Copy link
Member

ufechner7 commented Oct 19, 2023

I tried the following in the project QmlJuliaExamples

cd basic
julia --project

and then in Julia, after initiating the project:

include("listmodel-fromjulia.jl") # window pops up
QML.cleanup() # window closes
include("listmodel-fromjulia.jl") # crash

This crashes with

julia> include("listmodel-fromjulia.jl")

[64952] signal (11.2): Segmentation fault
in expression starting at /home/ufechner/repos/QmlJuliaExamples/basic/listmodel-fromjulia.jl:51
unknown function (ip: 0x7f63f5f75040)
unknown function (ip: 0x7f6329ffc58f)
Allocations: 6039630 (Pool: 6033552; Big: 6078); GC: 9
Segmentation fault (core dumped)

@barche Any idea?

@barche
Copy link
Collaborator

barche commented Oct 25, 2023

Instead of using cleanup directly, you should exit the REPL. After running exec_async, a new REPL is actually started, so exiting that one will bring you back to the original REPL and then you can restart the app. Note that there is still a problem with this, changing model values from Julia causes the stack issue we saw before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants