fix byte referencing

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2017-06-29 15:19:04 +03:00
parent d98d2dfc52
commit 3153ecf43a
2 changed files with 5 additions and 2 deletions

View File

@ -86,6 +86,9 @@ func (c *ClientConn) Close() error {
close(c.quit) close(c.quit)
c.quit = nil c.quit = nil
} }
if c.quitCh != nil {
close(c.quitCh)
}
return c.c.Close() return c.c.Close()
} }
@ -111,7 +114,7 @@ func (c *ClientConn) PixelFormat() *PixelFormat {
return c.pixelFormat return c.pixelFormat
} }
func (c *ClientConn) SetDesktopName(name []byte) { func (c *ClientConn) SetDesktopName(name []byte) {
c.desktopName = name copy(c.desktopName, name)
} }
func (c *ClientConn) SetPixelFormat(pf *PixelFormat) error { func (c *ClientConn) SetPixelFormat(pf *PixelFormat) error {
c.pixelFormat = pf c.pixelFormat = pf

View File

@ -94,7 +94,7 @@ func (c *ServerConn) PixelFormat() *PixelFormat {
return c.pixelFormat return c.pixelFormat
} }
func (c *ServerConn) SetDesktopName(name []byte) { func (c *ServerConn) SetDesktopName(name []byte) {
c.desktopName = name copy(c.desktopName, name)
} }
func (c *ServerConn) SetPixelFormat(pf *PixelFormat) error { func (c *ServerConn) SetPixelFormat(pf *PixelFormat) error {
c.pixelFormat = pf c.pixelFormat = pf