diff --git a/client.go b/client.go index ace1b34..097357d 100644 --- a/client.go +++ b/client.go @@ -86,6 +86,9 @@ func (c *ClientConn) Close() error { close(c.quit) c.quit = nil } + if c.quitCh != nil { + close(c.quitCh) + } return c.c.Close() } @@ -111,7 +114,7 @@ func (c *ClientConn) PixelFormat() *PixelFormat { return c.pixelFormat } func (c *ClientConn) SetDesktopName(name []byte) { - c.desktopName = name + copy(c.desktopName, name) } func (c *ClientConn) SetPixelFormat(pf *PixelFormat) error { c.pixelFormat = pf diff --git a/server.go b/server.go index 135f3b0..bdb244b 100644 --- a/server.go +++ b/server.go @@ -94,7 +94,7 @@ func (c *ServerConn) PixelFormat() *PixelFormat { return c.pixelFormat } func (c *ServerConn) SetDesktopName(name []byte) { - c.desktopName = name + copy(c.desktopName, name) } func (c *ServerConn) SetPixelFormat(pf *PixelFormat) error { c.pixelFormat = pf