Leakage from midi and audio track to other audio track.

If I record a guitar into an audio track and playing along to a midi track, like a drum machine, the sound of the midi track leaks into my audio track. So if I mute the drums I will still hear it in the guitar track. But there can also be leakage from an audio track to another audio track. How do I solve this? I use a Line 6 Pod connected with an IRig when I record guitars.

This has been a common problem with iPad recording.
The problem is the iRig. Any interface that uses the headphone/mic input of the iPad has this problem.
To do any serious recording with an iPad you need an interface that does the AD conversion and plugs into the 30 pin on the old iPads or the lightning on the newer iPads, ie the digital input connection of the iPad.

Thanks for the answer!
Do you have any recommendation when it comes to interfaces? I’ve no idea about those that you use for iPads.

Apogee Jam is quite good if you look for guitar recording only. If you want to record other audio sources also, or more sources in parallel i would go for a class compliant audio interface.