Slice leeks in half down the middle along their lengths and wash thoroughly.
Chop the leeks (the green and the white parts) and chop the peeled and halved onion.
Peel and core the apples then chop them as well.
Heat olive oil in wide frying pan and add chopped leeks, onion, apples and chestnuts as well as the whole sprigs of thyme.
Cook on medium heat for 10 minutes stirring occasionally to prevent it browning or sticking.
Meanwhile roll out 2/3 of the pastry to line a shallow quiche or pie tin about 10 to 12 inches in diameter and prick the base lightly with a fork.
Cook the pastry blind (with greaseproof paper and beans holding it down) for ten to fifteen minutes - unless you have an aga or solid fuel stove in which case you can place the whole pie including mixture and top on the solid bottom of the oven and it'll cook it all at the same time.
Season the leek, chestnut and apple mixture well with salt and ground white pepper and remove the thyme sprigs.
Add the mixture to fill the (baked) pastry case and then roll out the last third of the raw pastry in a circle big enough to fit over the top and damp the edge lightly with water.
Lift and cover the base and filling, press down firmly round the two edges with a fork and trim with a knife. Then prick or make a slash in the top so the air or steam can escape when cooking.
Bake in moderately hot oven (180C or 350F) for about half an hour or until golden brown.
Slice and serve with veg and gravy.