Solved QRunnable unavailable dynamically allocated member variables
I'm running into a weird behavior when dispatching the run() function of a class that inherits from QRunnable. The class in question has 2 member variables that are dynamically allocated in its constructor:
float *mBufferX = new float[mBufferXSize.toInt()]; float *mBufferY = new float[mBufferYSize.toInt()];
Now, whenever the run() function is invoked, these 2 variables are NULL. However, the object exist and thus its constructor was called. How is it that these variables are NULL?
Thank you very much!
kshegunov Moderators last edited by
Assuming you posted exactly what you wrote in your constructor, you shadow the members with the local variables.
Wow. How did I miss that...
Well that should solve it. Thanks!