The stable condition of multi-wavelength optical cavities is discussed by the method of ray-pulse matrices, and the formula of net GVD is deduced. As an example, a novel self-mode-locked cavity is analyzed and the magnitude of GVD is calculated. These conclusions are very useful for understanding the mechanism of mode-locking.