My question was exactly this.
If the leader car is pitting, the Turn Leader Marker has to be assigned to another car on track or not?
No. A car in the pit can still be in the lead. The rule governing this is located in the glossary:
Track Running Order – Every time a car is moved a new Running Order is created. The car that has both completed the most laps and is the fewest sectors away from crossing the Start/Finish line again is considered to be in the lead. The next spot in the order is then determined by the next car using the same criteria. If there is a tie for running order, teams closest to the inside lane in a sector are leading. Cars in the pit apron are always considered to be behind cars on the track in the same sector.