Partially fixed Triangle mamory leak