fix free/delete mismatch on con close