
202 Cal.App.3d 1298 (1988)
249 Cal. Rptr. 277
DAVID SATINOVER, Plaintiff and Appellant,
v.
PAT DEAN et al., Defendants and Respondents.
Docket No. B026373.
Court of Appeals of California, Second District, Division Seven.
July 21, 1988.
*1299 COUNSEL
Jeffrey L. Davidson for Plaintiff and Appellant.
Gerald McNally, Jr., for Defendants and Respondents.
OPINION
LILLIE, P.J.
David Satinover appeals from an order of the superior court requiring the clerk of the court to pay defendants Pat Dean and Shelter Canyon, Inc., certain money from a cash deposit in lieu of bond. He contends the court erred in ordering recovery on the deposit in lieu of bond prior to the entry of a final judgment.

I

FACTUAL AND PROCEDURAL BACKGROUND
In 1985, Satinover, Dean and Shelter Canyon, Inc. (Shelter), entered into a written employment contract whereby Satinover agreed to represent Dean in various business pursuits and Shelter agreed to be jointly and severally liable with Dean to Satinover.
Pursuant to the terms of the employment agreement, Satinover was given the exclusive use of a 1985 Mercedes Benz station wagon and an option to purchase the automobile for its "blue book" price at any time within 30 days after the termination of his employment.
In May 1986, Dean and Shelter failed to pay Satinover his basic monthly salary of $25,000, and Satinover filed a complaint in superior court for *1300 damages and injunctive relief for breach of contract, work and services performed and declaratory relief. The complaint prayed for a temporary restraining order and preliminary and permanent injunction "enjoining and restraining defendants ... from misappropriating, disbursing, transferring, assigning, licensing, expending, secreting, encumbering or otherwise disposing of their assets."
On August 20, 1986, Satinover obtained a temporary restraining order and an order to show cause why a preliminary injunction should not be issued. The temporary restraining order enjoined and restrained defendants from interfering with plaintiff's sole and exclusive possession and use of the 1985 Mercedes Benz station wagon. As a condition of the issuance of the restraining order, Satinover posted a deposit in lieu of bond in the amount of $22,000.
On October 31, 1986, Satinover's application for a preliminary injunction was denied. On January 12, 1987, upon motion of defendants, the superior court ordered the clerk of the court to pay defendants the sum of $14,718.85 from plaintiff's deposit in lieu of bond. That sum represented defendants' attorney's fees incurred in opposing the application for a temporary restraining order and preliminary injunction and damages incurred by the defendants as a result of the temporary restraining order. The court found that Satinover had no right to a preliminary injunction restraining defendants from interfering with his possession of the 1985 Mercedes Benz station wagon and that "[t]he dissolution of the temporary restraining order and denial of the preliminary injunction constituted the final determination requisite to the accrual of defendants' claims against the injunction deposit posted with the Court by plaintiff David Satinover." It is from the order directing the clerk of the court to pay defendants $14,718.85 from the deposit in lieu of bond posted that Satinover appeals.

II

DISCUSSION
(1) Satinover's contention that the motion to enforce liability on the bond was premature is well taken.
Code of Civil Procedure section 996.440 provides in relevant part: "(a) If a bond is given in an action or proceeding, the liability on the bond may be enforced on motion made in the court without the necessity of an independent action. [¶] (b) The motion shall not be made until after entry of the final judgment in the action or proceeding in which the bond is given and *1301 the time for appeal has expired or, if an appeal is taken, until the appeal is finally determined."
The dissolution of the temporary restraining order or the refusal to grant a preliminary injunction is not enough. The main action has to be terminated before an action to recover an undertaking may be brought. (See Clark v. Clayton (1882) 61 Cal. 634, 638; Allen v. Pitchess (1973) 36 Cal. App.3d 321, 330 [111 Cal. Rptr. 658]; Nuclear Electronic Laboratories, Inc. v. William C. Cornell Co. (1965) 239 Cal. App.2d 8, 10 [48 Cal. Rptr. 416].)
In the present case, the motion to enforce liability on the deposit posted in lieu of a bond was brought prematurely. The action in which the undertaking was granted is still pending for trial.

III

DISPOSITION
The order is reversed. Appellant to have costs on appeal.
Johnson, J., and Kolts, J.,[*] concurred.
NOTES
[*]   Assigned by the Chairperson of the Judicial Council.
