mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-29 04:50:06 +00:00
client closes peerconnection
This commit is contained in:
parent
8c4f6f624e
commit
2a782100a0
4 changed files with 25 additions and 5 deletions
|
|
@ -24,6 +24,7 @@ type Director struct {
|
|||
const FPS = 60
|
||||
|
||||
func NewDirector(roomID string, imageChannel chan *image.RGBA, audioChannel chan float32, inputChannel chan int) *Director {
|
||||
// return image channel from where it write
|
||||
director := Director{}
|
||||
director.Done = make(chan struct{})
|
||||
director.audioChannel = audioChannel
|
||||
|
|
|
|||
|
|
@ -130,6 +130,10 @@ func (view *GameView) Exit() {
|
|||
if cartridge.Battery != 0 {
|
||||
writeSRAM(sramPath(view.saveFile), cartridge.SRAM)
|
||||
}
|
||||
|
||||
// close producer
|
||||
close(view.imageChannel)
|
||||
close(view.audioChannel)
|
||||
}
|
||||
|
||||
// Update is called for every period of time, dt is the elapsed time from the last frame
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue