Both possibilities are true. Moksha is not an automatic process. It is the result of a long sadhana. The sadhana is usually done in the body because all the elements necessary for the sadhana, – thought, will, emotions are parts of nature and leave us one by one after death. Besides there is no more centralising will after death and hence concentration which is the key to sadhana is not possible after death. Besides the knot of karma has to opened and exhausted only through the experiences of life and not after death.
However there is an exception whence one has lived a conscious life integrating everything around the soul and only a little is left. In such an instance, one may continue the little remaining part of the sadhana after death. But as a general rule sadhana and its result moksha is realised only during life.
Affectionately,
Alok Da


