Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
CSampleQueue memory deallocation
AAnil last edited by
I have a code like below
Where RB_ANALOGTOOL_MAXNUMCHANNELS = 18;
for(int k=0; k<RB_ANALOGTOOL_MAXNUMCHANNELS; k++)
m_QueuesDig[k] = new cSampleQueue(0,-1);
for (int k=0; k<RB_ANALOGTOOL_MAXNUMCHANNELS; k++)
I want to know whether line 3 will deallocate the memory or just clear the data in each location.
If it does not deallocate the memory let me know how it can be done.
I am trying delete m_QueuesDig but getting violation."This may be due to a corruption of the heap,which indicates a bug in adtf_devenv.exe or any of the DLLs it has loaded".
Can any one let me know some solution regarding above problem.
alexisdm last edited by
To be able to do that:
@m_QueuesDig[k] = new cSampleQueue(0,-1);@
you should define an array of pointers:
and then you'll be able to delete each one separately like this: