On Do, 2015-09-03 at 12:08 +0200, Peter Lieven wrote: > Am 03.09.2015 um 11:57 schrieb Gerd Hoffmann: > > On Do, 2015-08-27 at 12:18 +0200, Peter Lieven wrote: > >> if no client is connected there is no need to keep the server > >> surface. Throw it away and replace it with a dummy surface to > >> save memory. > > No dummy surface please. Just set vd->server = NULL. > > I can do that, but I have to check for vd->server == NULL at some points then.
Sure. That'll shortcut code paths which should not have any effect anyway. You probably also want factor out server surface initialization into a function which is called for both first vnc connect and surface changes. Oh, and btw: in case the surface changes without resolution/depth changing (guest page flip) we might simply skip surface (re-)initialization. cheers, Gerd