Skip to content

slint::invoke_from_event_loop SegFault (C++) #2365

Answered by gammaEmitter
gammaEmitter asked this question in Q&A
Discussion options

You must be logged in to vote
  • Calling lock() returned a std::optional<slint::ComponentHandle<HelloWorld>> which my function could not been called from (Member does not exist)
  • Calling lock().__get() returned the correct slint::ComponentHandle<HelloWorld> which I could call my function from, yet it terminated the app, wanting me to call the function from slint::invoke_from_event_loop (dispite I did call by it)

Wrong Lines:

slint::ComponentHandle<HelloWorld> * AppHandle = (slint::ComponentHandle<HelloWorld> *) arguments->App;
slint::invoke_from_event_loop([&](){(*AppHandle)->fn_set_meter_to_value(0.5f);}); 

Correct Solution: I was not passing AppHandle in the lambdas capture clause

slint::ComponentHandle<HelloWorld> A…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@gammaEmitter
Comment options

@ogoffart
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gammaEmitter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants