filcuc / nimqml

Qt Qml bindings for the Nim programming language
Other
161 stars 20 forks source link

Crash calling beginResetModel() #39

Closed Dax89 closed 2 years ago

Dax89 commented 2 years ago

Hi!

I'm trying to do a simple application so I can learn Nim by doing something fun, I've encountered a strange issue in my Qml Model:

Traceback (most recent call last)
/home/davide/Programmazione/Progetti/NIM/GHReleases/src/ghreleases.nim(16) ghreleases
/home/davide/Programmazione/Progetti/NIM/GHReleases/src/ghreleases.nim(13) main
/home/davide/.nimble/pkgs/nimqml-0.9.1/nimqml/private/qapplication.nim(8) exec
/home/davide/.nimble/pkgs/nimqml-0.9.1/nimqml/private/qobject.nim(131) qobjectCallback
/home/davide/.nimble/pkgs/nimqml-0.9.1/nimqml/private/qobject.nim(116) onSlotCalled
(4)                      onSlotCalled
/home/davide/Programmazione/Progetti/NIM/GHReleases/src/githubapi.nim(74) setUrl
/home/davide/.nimble/pkgs/nimqml-0.9.1/nimqml/private/qabstractitemmodel.nim(215) beginResetModel
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
zsh: segmentation fault (core dumped)  ./ghreleases

Basically the application crashes when I call beginResetModel(), if I remove this function call it hangs when the urlChanged() signal is called in setUrl() function (implemented in githubapi.nim).

OS and Packages versions:

I have attached the application's source code (it's very small): GHReleases.tar.gz

Am I doing something wrong?

filcuc commented 2 years ago

Should be fixed with the latest master of DOtherSide see commit https://github.com/filcuc/dotherside/commit/41873d41e96a7665f921f66a466f89c347fe4126

Dax89 commented 2 years ago

It works! Grazie mille :1st_place_medal: