Sometimes, shareholders agreements will include terms that explicitly don't require shareholders to invest additional capital.
However, if the other shareholders choose to put in more capital, your ownership can be diluted. Or, if you refuse to contribute more, the other shareholders can buy you out.
If your other partners are determined to keep the company going and you want to leave, you may want to consider making a proposal that they buy out your interest-- rather than forcing the company to dissolve -- so that at least you can leave the sinking ship, even if they choose not to.
An attorney can help you explore the options and craft the proposal.