at the end, I have deleted the object pointer, however valgrind keeps telling me there is memory leak caused by new operator in this function.
This is the output of valgrind
==24573== 2,388 (24 direct, 2,364 indirect) bytes in 2 blocks are definitely lost in loss record 47 of 64
==24573== at 0x402A6DC: operator new(unsigned int) (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==24573== by 0x806C92F: g_markCells(int) (in /home/hidayat/projects/32rrnn/bin/rrnn)
==24573== by 0x806CD02: gridDynamic_RRNN() (in /home/hidayat/projects/32rrnn/bin/rrnn)
==24573== by 0x804BCE2: main (in /home/hidayat/projects/32rrnn/bin/rrnn)
Would someone please tell me how to delete the object pointer in priority queue so that the memory leak gone? Thanks