Release queue when it is not NULL