Section 44. A limited partnership is dissolved and its affairs shall be closed upon the happening of the first to occur of the following:
(1) at the time specified in writing in the partnership agreement;
(2) upon the happening of events specified in writing in the partnership agreement;
(3) written consent of all partners;
(4) an event of withdrawal of a general partner unless at the time there is at least one other general partner and the written provisions of the partnership agreement permit the business of the limited partnership to be carried on by the remaining general partner and that partner does so, but the limited partnership is not dissolved and is not required to close its affairs by reason of any event of withdrawal, if, within ninety days after the withdrawal, all partners agree in writing to continue the business of the limited partnership and to the appointment of one or more additional general partners if necessary or desired; or
(5) entry of a decree of judicial dissolution under section forty-five.