Thank you all for your very quick replies.
I have indeed used mq_unlink command to terminate the message queues.
Thanx for pointing out "ipcs" command. Now there's a major problem. In my program I create 2 threads which create message queues for communication. Still, when the program is running, "IPCS" command output doesn't show anything. It says no shared memory/MQ/Semaphore. I'm confused, does that mean my problem is not related to message queues? And why it doesn't show any message queues?
Bdw, I'm running the system on a arm based core