After the trial court sustained defendants’ demurrer with leave to amend, plaintiff filed an amended complaint which no longer named the HOA as a defendant and stated no claim against it.  Under CCP 581(f)(2), the trial court had discretion (which it did not abuse) to dismiss the HOA with prejudice.  If plaintiff had wished to dismiss the HOA without prejudice, he should have requested the HOA’s dismissal before filing the amended complaint, or should have filed an amended complaint stating claims against the HOA and then requested the HOA’s dismissal without prejudice.  The trial court also did not abuse its discretion in awarding the HOA $48,000 in attorney fees under CC 5975(c) which provides for attorney fee awards to the prevailing party in litigation over an HOA’s governing documents.  The dismissal with prejudice after the sustaining of its demurrer showed that the HOA was the prevailing party having succeeded in its objectives in the lawsuit.