Solved program crashes after assigning values to array elements
-
https://ufile.io/g2azi
I built a minimal compilable example that only read table cells and put them in array elements.
it doesn't crashes!
so I uploaded my current crashing program.
after run choose setaddres from parameters menu and then set number of rows with spinbox and click set button
then fill cells and then click apply.
if for first time program didn't crashed close it and re run -
@rezaMSLM It did not compile on my Linux machine until I fixed all wrong connect() calls.
It does not crash here, not in debug and not in release mode. -
@jsulm said in program crashes after assigning values to array elements:
It does not crash here, not in debug and not in release mode.
on my pc also doesn't crash some times
set number of rows to something near 20 like 17
and test it several times(each time close all windows and run it again) -
@rezaMSLM
same for my MacOS machineDoesn't compile until connects are fixed -> no crash on apply or after apply and resizing the window.
However the buttons ok and cancel have no effect, not sure if that's intended.
-
@rezaMSLM What I don't understand: why do you use an array (which has fixed size) to store elements from a table which has dynamic size? Why not use a QVector for that?
-
@jsulm said in program crashes after assigning values to array elements:
@rezaMSLM What I don't understand: why do you use an array (which has fixed size) to store elements from a table which has dynamic size? Why not use a QVector for that?
I will do it
but when I got crashes in the program focused on finding the cause.
then I will go to next step and use dynamic array. -
here is a video from the program crash on my pc
https://ufile.io/2o2co -
@rezaMSLM nope
followed the video to a T and no crash.Try deleting your build folder for a clean rebuild, also what qt version and compiler are you using?
-
@J.Hilk said in program crashes after assigning values to array elements:
@rezaMSLM nope
followed the video to a T and no crash.Try deleting your build folder for a clean rebuild, also what qt version and compiler are you using?
qt5.9.6
mingw5.3 -
@J.Hilk said in program crashes after assigning values to array elements:
Try deleting your build folder for a clean rebuild,
I think this solved my problem
no crash has occurred since I did that.
Thankyou J.hilk and jsulm for your helpbut I don't understand why rebuilding was the solution